1
Fork 0
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:
Mark H Weaver 2013-07-16 00:22:10 -04:00
parent 0132928891
commit ba0e46ea1b

View file

@ -33,7 +33,10 @@
(not (not (object-documentation object)))) (not (not (object-documentation object))))
(define fixnum-bit (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-min most-negative-fixnum)
(define fixnum-max most-positive-fixnum) (define fixnum-max most-positive-fixnum)