projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
1.0.2:
[sbcl.git]
/
src
/
code
/
bignum.lisp
diff --git
a/src/code/bignum.lisp
b/src/code/bignum.lisp
index
9374acc
..
c07fc19
100644
(file)
--- a/
src/code/bignum.lisp
+++ b/
src/code/bignum.lisp
@@
-1320,16
+1320,18
@@
(defun bignum-logcount (bignum)
(declare (type bignum-type bignum))
(defun bignum-logcount (bignum)
(declare (type bignum-type bignum))
- (let* ((length (%bignum-length bignum))
- (plusp (%bignum-0-or-plusp bignum length))
- (result 0))
+ (let ((length (%bignum-length bignum))
+ (result 0))
(declare (type bignum-index length)
(fixnum result))
(do ((index 0 (1+ index)))
(declare (type bignum-index length)
(fixnum result))
(do ((index 0 (1+ index)))
- ((= index length) result)
+ ((= index length)
+ (if (%bignum-0-or-plusp bignum length)
+ result
+ (- (* length digit-size) result)))
(let ((digit (%bignum-ref bignum index)))
(declare (type bignum-element-type digit))
(let ((digit (%bignum-ref bignum index)))
(declare (type bignum-element-type digit))
- (incf result (logcount (if plusp digit (%lognot digit))))))))
+ (incf result (logcount digit))))))
\f
;;;; logical operations
\f
;;;; logical operations