Returns an long
with specific bits set to a specific state, where 'origValue'
is the input value to perform the action on, 'bitArray'
is a array containing a list bit numbers (starting from 1) to set the state of, and 'bitState'
is either 1
or 0
, indicating which state to set those bits.
Namespace
logical
Input
origValue (long)
bitArray (int[])
bitState (1 or 0)
Output
number (long)
Example
If origValue
contains the number 352
, bitArray
contains the list [2,4,8]
, and bitState
contains the value 1
, then the following two functions are equivalent, and return the value 494
:
...