Bit vectors can be written and read as a sequence of `0`

s and
`1`

s prefixed by `#*`

.

#b(#f #f #f #t #f #t #f) => #*0001010

Some of these operations will eventually be generalized to other uniform-arrays.

__primitive:__**bit-count***bool bv*-
Returns the number occurrences of
`bool`in`bv`.

__primitive:__**bit-position***bool bv k*-
Returns the minimum index of an occurrence of
`bool`in`bv`which is at least`k`. If no`bool`occurs within the specified range`#f`

is returned.

__primitive:__**bit-invert!***bv*-
Modifies
`bv`by replacing each element with its negation.

__primitive:__**bit-set*!***bv uve bool*-
If uve is a bit-vector
`bv`and uve must be of the same length. If`bool`is`#t`

, uve is OR'ed into`bv`; If`bool`is`#f`

, the inversion of uve is AND'ed into`bv`.If uve is a unsigned integer vector all the elements of uve must be between 0 and the

`LENGTH`

of`bv`. The bits of`bv`corresponding to the indexes in uve are set to`bool`.The return value is unspecified.

__primitive:__**bit-count****bv uve bool*-
Returns
(bit-count (bit-set*! (if bool bv (bit-invert! bv)) uve #t) #t).

`bv`is not modified.

Go to the first, previous, next, last section, table of contents.