Miou_bitvThis module implements bit vectors, as an abstract datatype t. Since bit vectors are particular cases of arrays, this module provides the same operations as module Array. It also provides bitwise operations and conversions to/from integer types.
In the following, false stands for bit 0 and true for bit 1.
val create : int -> bool -> tcreate n b creates a new bit vector of length n, initialized with b.
val length : t -> intlength returns the length (number of elements) of the given vector.
val next : t -> int optionnext v returns the next unset nth bit of v.
val max : t -> intval get : t -> int -> boolget v n returns the nth bit of v.
val set : t -> int -> bool -> unitset v n b sets the nth bit of v to the value b.
val iter : (int -> unit) -> t -> unititer fn v applies function fn in turn to all indexes of the elements of v which are set (i.e. true); indexes are visited from least significant to most significant.