Member of the bitwise class.
c = bitset(a, b)
c = bitset(a, b, d)
Sets the value of a bit at a particular position in a number. For example, if a = 5 (101), bitset(a, 4) = 13 (1101).
| Name | Description |
| a | Specifies a positive integer. a must be less than bitmax. |
| b | Specifies the position of the bit whose value you want to set. b is an integer. |
| d | Specifies the value to which you want to set the bit at position b. d must be 0 or 1. The default is 1. |
| Name | Description |
| c | Returns a with the bit in position b set to d. |
A = 2340
C = bitset(A, 1)