chickadee » bitwise-utils » bitwise-mask

bitwise-mask WID #!optional ON?procedure

Returns WID low-order bits ON?.

WID
fixnum ; mask bit width.
ON?
boolean ; #t is #b1, #f is #b0; default #t.
(bitwise-mask 5 #t) ;=> +0...011111 (#b+011111)
(bitwise-mask 5 #f) ;=> -1...100000 (#b-100000)