Bit_Array module

set_bit_to

procedureSource

Sets bit i when value is true and clears it otherwise; this is what bits[i] = value does.

Example↗
bits := make_bit_array(4);
set_bit_to(*bits, 1, true);
assert(bits[1]);
set_bit_to(*bits, 1, false);
assert(!bits[1]);
deinit(*bits);
set_bit_to :: (array: *Bit_Array, i: int, value: bool)

Parameters

array: *Bit_Array
i: int
value: bool

See also