From 6f6847fa21a141b447dba59248d3c2bbcb8dbef4 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Sun, 13 Mar 2005 00:14:23 +0000 Subject: [PATCH] (=): Exercise inum/flonum cases that used to round on 64-bit systems. --- 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 9c2588fdd..6934a34ce 100644 --- a/test-suite/tests/numbers.test +++ b/test-suite/tests/numbers.test @@ -1483,7 +1483,17 @@ (pass-if (= 0.5+0i 1/2)) (pass-if (not (= 0.5+0i 2/3))) - (pass-if (not (= 0+0.5i 1/2)))) + (pass-if (not (= 0+0.5i 1/2))) + + ;; prior to guile 1.8, inum/flonum comparisons were done just by + ;; converting the inum to a double, which on a 64-bit would round making + ;; say inexact 2^58 appear equal to exact 2^58+1 + (pass-if (= (ash-flo 1.0 58) (ash 1 58))) + (pass-if (not (= (ash-flo 1.0 58) (1+ (ash 1 58))))) + (pass-if (not (= (ash-flo 1.0 58) (1- (ash 1 58))))) + (pass-if (= (ash 1 58) (ash-flo 1.0 58))) + (pass-if (not (= (1+ (ash 1 58)) (ash-flo 1.0 58)))) + (pass-if (not (= (1- (ash 1 58)) (ash-flo 1.0 58))))) ;;; ;;; <