next up previous contents index
Next: coerce,machine Up: IntegerType Previous: IntegerType   Contents   Index


bit?,clear,set


Usage

bit?(a, n)
clear(a, n)
set(a, n)


Signatures

bit?: (%, MachineInteger) $\to$ Boolean
clear, set: (%, MachineInteger) $\to$ %


Parameter Type Description
a % an integer
n MachineInteger a nonnegative machine integer


Returns

bit?(a, n) returns true if the ${n}^{{\rm th}}$ bit of a is 1, false if it is 0, while clear(a, n) and set(a, n) return copies of a where the ${n}^{{\rm th}}$ bit is set respectively to 0 and 1. For all 3 functions, the rightmost bit of a is the ${0}^{{\rm th}}$ bit and so on.



Manuel Bronstein 2004-06-28