Sets the value of a bit at a particular position in a number. For example, if a = 5 (101), bitset(a,4) = 13 (1101).
c = bitset(a, b)
c = bitset(a, b, d)
c = bitset(a, b, d, e)
Scalar or array of any dimension of integers. If you use c = bitset(a, b) or c = bitset(a, b, d), a is of type uint64. If you use c = bitset(a, b, d, e), a is of type e.
Position of the bit whose value you want to set. b is a positive integer.
Value to which you want to set the bit at position b. d is a real value. If d = 0, bitset sets this bit to 0, otherwise to 1.
Assumed data type of a. e is a string.
Name | Description |
---|---|
'uint64' | uint64 |
'uint32' | uint32 |
'uint16' | uint16 |
'uint8' | uint8 |
'int64' | int64 |
'int32' | int32 |
'int16' | int16 |
'int8' | int8 |
a with the bit in position b set to d.
A = 2340; C = bitset(A, 1)
Where This Node Can Run:
Desktop OS: Windows
FPGA: Not supported