chickadee » srfi-60 » bit-field

bit-field n start endprocedure

Returns the integer composed of the start (inclusive) through end (exclusive) bits of n. The startth bit becomes the 0-th bit in the result.

Example:

(number->string (bit-field #b1101101010 0 4) 2)
   ; => "1010"
(number->string (bit-field #b1101101010 4 9) 2)
   ; => "10110"