Returns the bit at the specified position in a number.
This function performs a bitwise AND operation to isolate the bit at the kth position. If the bit is 0, it returns 0; otherwise, it returns 1.
k
0
1
The bit at position k (either 0 or 1).
The number whose bit will be retrieved.
The position of the bit to retrieve (0-indexed).
Generated using TypeDoc
Returns the bit at the specified position in a number.
This function performs a bitwise AND operation to isolate the bit at the
kth position. If the bit is 0, it returns0; otherwise, it returns1.Returns
The bit at position
k(either 0 or 1).