Skip to content

Commit 5848bdc

Browse files
author
Amirouche
committed
srfi/:151: bitwise operations: add tests and fix bit-field-rotate...
... for negative values.
1 parent 8ece901 commit 5848bdc

File tree

3 files changed

+849
-1
lines changed

3 files changed

+849
-1
lines changed

%3a151/bitwise-operations.sls

+3-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@
147147

148148
(define bit-field-rotate
149149
(lambda (i count start end)
150-
(bitwise-rotate-bit-field i start end count)))
150+
(if (negative? count)
151+
(bitwise-rotate-bit-field i start end (fx+ count (fx- end start)))
152+
(bitwise-rotate-bit-field i start end count))))
151153

152154
(define bit-field-reverse
153155
(lambda (i start end)

0 commit comments

Comments
 (0)