bits.scm 307 B

1234567891011121314151617
  1. (define-module (utils bits))
  2. (use-modules
  3. ;; SRFI 60: procedures for treating integers as bits
  4. (srfi srfi-60))
  5. (define-public bits-left-shift
  6. (lambda (bits count)
  7. (arithmetic-shift bits count)))
  8. (define-public bits-right-shift
  9. (lambda (bits count)
  10. (arithmetic-shift bits (* -1 count))))