From d8e59af349ffea809e03754367a44bad53bdbf9d Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Tue, 9 May 2006 00:31:48 +0000 Subject: [PATCH] (exact->inexact): Test fractions big/big. --- test-suite/tests/numbers.test | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test-suite/tests/numbers.test b/test-suite/tests/numbers.test index 54117b044..57ebe5508 100644 --- a/test-suite/tests/numbers.test +++ b/test-suite/tests/numbers.test @@ -2745,7 +2745,17 @@ (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))) ((> 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