mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-05 06:50:21 +02:00
(exact->inexact): Test fractions big/big.
This commit is contained in:
parent
b80fcfc4ad
commit
d8e59af349
1 changed files with 11 additions and 1 deletions
|
@ -2745,7 +2745,17 @@
|
||||||
(n (- (ash 1 (+ 2 dbl-mant-dig)) 1) (1- (* 2 n)))
|
(n (- (ash 1 (+ 2 dbl-mant-dig)) 1) (1- (* 2 n)))
|
||||||
(want (+ (ash-flo 1.0 (+ 2 dbl-mant-dig)) 4.0) (* 2.0 want)))
|
(want (+ (ash-flo 1.0 (+ 2 dbl-mant-dig)) 4.0) (* 2.0 want)))
|
||||||
((> i 100))
|
((> i 100))
|
||||||
(try-i i n want))))
|
(try-i i n want)))
|
||||||
|
|
||||||
|
(pass-if "frac big/big"
|
||||||
|
(let ((big (ash 1 256)))
|
||||||
|
(= 1.0 (exact->inexact (/ (1+ big) big)))))
|
||||||
|
|
||||||
|
;; In guile 1.8.0 this failed, giving back "nan" because it tried to
|
||||||
|
;; convert the num and den to doubles, resulting in infs.
|
||||||
|
(pass-if "frac big/big, exceeding double"
|
||||||
|
(let ((big (ash 1 4096)))
|
||||||
|
(= 1.0 (exact->inexact (/ (1+ big) big))))))
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
;;; floor
|
;;; floor
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue