/
SetBit function
SetBit function
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
:
set-column val logical:SetBit(356, [2,4,8], 1)
set-column val logical:Not(origValue, bitArray, bitState)
set-column val logical:Not('value')
, multiple selections available,
Related content
BitAnd function
BitAnd function
More like this
Logical Bitwise functions
Logical Bitwise functions
More like this
BitCompress function
BitCompress function
More like this
BitXor function
BitXor function
More like this
BitOr function
BitOr function
More like this
Equal function
Equal function
More like this
Created in 2020 by Google Inc.