diff options
author | Mark H Weaver <mhw@netris.org> | 2013-07-16 01:33:27 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2013-07-16 01:33:27 -0400 |
commit | 28d5d2537c0321643c3b511a2195cd491204e7f2 (patch) | |
tree | 16b46ded431848672722595b87024fb7ffc48142 /module/rnrs | |
parent | 178a40928ab5221f6ce57c5af1067abe30a342b3 (diff) | |
parent | 95ed221785f5b1203e998823455f682c1830498b (diff) | |
download | guile-28d5d2537c0321643c3b511a2195cd491204e7f2.tar.gz |
Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
libguile/keywords.c
libguile/vm.c
Diffstat (limited to 'module/rnrs')
-rw-r--r-- | module/rnrs/arithmetic/bitwise.scm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/module/rnrs/arithmetic/bitwise.scm b/module/rnrs/arithmetic/bitwise.scm index bb3a20797..ac870ff79 100644 --- a/module/rnrs/arithmetic/bitwise.scm +++ b/module/rnrs/arithmetic/bitwise.scm @@ -53,9 +53,13 @@ (logand bitwise-and) (logior bitwise-ior) (logxor bitwise-xor) - (logcount bitwise-bit-count) (ash bitwise-arithmetic-shift))) + (define (bitwise-bit-count ei) + (if (negative? ei) + (bitwise-not (logcount ei)) + (logcount ei))) + (define (bitwise-if ei1 ei2 ei3) (bitwise-ior (bitwise-and ei1 ei2) (bitwise-and (bitwise-not ei1) ei3))) |