mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-06 12:10:28 +02:00
numbers.test: Avoid inexact arithmetic in computation of fixnum-bit.
* test-suite/tests/numbers.test (fixnum-bit): Rewrite to avoid inexact arithmetic.
This commit is contained in:
parent
0132928891
commit
ba0e46ea1b
1 changed files with 4 additions and 1 deletions
|
@ -33,7 +33,10 @@
|
|||
(not (not (object-documentation object))))
|
||||
|
||||
(define fixnum-bit
|
||||
(inexact->exact (+ (/ (log (+ most-positive-fixnum 1)) (log 2)) 1)))
|
||||
(do ((i 0 (+ 1 i))
|
||||
(n 1 (* 2 n)))
|
||||
((> n most-positive-fixnum)
|
||||
(+ 1 i))))
|
||||
|
||||
(define fixnum-min most-negative-fixnum)
|
||||
(define fixnum-max most-positive-fixnum)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue