Function hasBit( value, bitIndex )
- Description:
-
Determines whether a given integer has a certain bit set to 1.
- Parameters:
-
- value (long integer)
- integer whose bits are to be tested
- bitIndex (integer)
- index of bit to be tested in range 0..63,
where 0 is the least significant bit
- Return Value (boolean):
- true if bit is set; more or less equivalent to
(value & 1L<<bitIndex) != 0
- Examples:
hasBit(64, 6) = true
hasBit(63, 6) = false
- Signature:
- boolean hasBit(long, int)