summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-scheme/gauche/files/gauche-0.9.1-number.diff')
-rw-r--r--dev-scheme/gauche/files/gauche-0.9.1-number.diff38
1 files changed, 38 insertions, 0 deletions
diff --git a/dev-scheme/gauche/files/gauche-0.9.1-number.diff b/dev-scheme/gauche/files/gauche-0.9.1-number.diff
new file mode 100644
index 000000000000..53f71172b2ff
--- /dev/null
+++ b/dev-scheme/gauche/files/gauche-0.9.1-number.diff
@@ -0,0 +1,38 @@
+From da6fc0f158fa9c76e5df675f57b57aa8c7a4b1b7 Mon Sep 17 00:00:00 2001
+From: Shiro Kawai <shiro@acm.org>
+Date: Wed, 2 Feb 2011 14:35:21 +0000
+Subject: correct error estimation of floating point number reader
+
+
+diff --git a/src/number.c b/src/number.c
+index 9a7d8f8..d121edd 100644
+--- a/src/number.c
++++ b/src/number.c
+@@ -3543,6 +3543,7 @@ static double algorithmR(ScmObj f, int e, double z)
+ case -1: /* d2 < y */
+ if (Scm_NumCmp(m, SCM_2_52) == 0
+ && sign_d < 0
++ && k > -1074
+ && Scm_NumCmp(Scm_Ash(d2, 1), y) > 0) {
+ goto prevfloat;
+ } else {
+diff --git a/test/number.scm b/test/number.scm
+index d397630..eb6d7eb 100644
+--- a/test/number.scm
++++ b/test/number.scm
+@@ -270,6 +270,12 @@
+ (test* "flonum reader (minimum denormalized number -5.0e-324)" #t
+ (let1 x (- (expt 2.0 -1074))
+ (= x (string->number (number->string x)))))
++
++;; This hanged in 0.9.1. See Jens Thiele's message in gauche-devel
++;; in Feb. 2011.
++(test* "flonum reader (minimum normalized number)" #t
++ (= (expt 2.0 (- 52 1074))
++ (string->number "2.2250738585072012e-308")))
+
+
+ (test* "padding" '(10.0 #t) (flonum-test '1#))
+--
+1.7.3.4
+