8.16.0.1
6.1 Bits
(require rebellion/binary/bit) | package: rebellion |
A bit is either zero or one. Eight bits form a byte, and a bitstring is an arbitrary-length sequence of bits.
A predicate for bits.
procedure
(bit->boolean b) → boolean?
b : bit?
Converts zero to false and one to true.
Examples:
> (bit->boolean 0) #f
> (bit->boolean 1) #t
procedure
(boolean->bit bool) → bit?
bool : boolean?
Converts true to one and false to zero.
Examples:
> (boolean->bit #true) 1
> (boolean->bit #false) 0