chickadee » srfi-60 » integer-length

integer-length nprocedure

Returns the number of bits neccessary to represent n.

Example:

(integer-length #b10101010)
   ; => 8
(integer-length 0)
   ; => 0
(integer-length #b1111)
   ; => 4