chickadee » srfi-60 » ash

ash n countprocedure
arithmetic-shift n countprocedure

Returns an integer equivalent to (inexact->exact (floor (* n (expt 2 count)))).

Example:

(number->string (ash #b1 3) 2)
   ; => "1000"
(number->string (ash #b1010 -1) 2)
   ; => "101"