projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More efficient integer division by multiplication
[sbcl.git]
/
tests
/
arith.pure.lisp
diff --git
a/tests/arith.pure.lisp
b/tests/arith.pure.lisp
index
b1ebdb2
..
d58da25
100644
(file)
--- a/
tests/arith.pure.lisp
+++ b/
tests/arith.pure.lisp
@@
-456,7
+456,8
@@
,@(loop repeat 4
collect (+ 10000 (random 101)))
,@(loop for i from 4 to sb-vm:n-word-bits
,@(loop repeat 4
collect (+ 10000 (random 101)))
,@(loop for i from 4 to sb-vm:n-word-bits
- for r = (random (expt 2 i))
+ for pow = (expt 2 (1- i))
+ for r = (+ pow (random pow))
collect r)))
(when (typep dividend dividend-type)
(multiple-value-bind (q1 r1)
collect r)))
(when (typep dividend dividend-type)
(multiple-value-bind (q1 r1)