chickadee » srfi-60 » logbit?

logbit? index nprocedure
bit-set? index nprocedure

Example:

(logbit? index n) == (logtest (expt 2 index) n)

(logbit? 0 #b1101) ; => #t
(logbit? 1 #b1101) ; => #f
(logbit? 2 #b1101) ; => #t
(logbit? 3 #b1101) ; => #t
(logbit? 4 #b1101) ; => #f