summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-05-11 09:23:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-05-11 09:23:21 +0000
commitcd34fa25495f7f1e7968b5a85d18ad0467e5cb71 (patch)
tree5d6158165d140a352c7698823f2b748ef27b90ed
parent61af9232d8a6ac1eae880a789335dfdbb7399ba2 (diff)
downloadruby-cd34fa25495f7f1e7968b5a85d18ad0467e5cb71.tar.gz
ruby-cd34fa25495f7f1e7968b5a85d18ad0467e5cb71.tar.xz
ruby-cd34fa25495f7f1e7968b5a85d18ad0467e5cb71.zip
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--util.c7
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 6dd99872e..b2f0c13c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu May 11 18:10:43 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * util.c (ruby_strtod): should not raise ERANGE when the input
+ string does not have any digits. [ruby-dev:28629]
+
Sun May 7 03:09:51 2006 Stephan Maka <stephan@spaceboyz.net>
* lib/resolv.rb (Resolv::DNS::Requester::ConnectedUDP#initialize):
diff --git a/util.c b/util.c
index 42ab81039..1b6094850 100644
--- a/util.c
+++ b/util.c
@@ -681,8 +681,8 @@ ruby_getcwd()
*
*/
-static int MDMINEXPT = -323;
-static int MDMAXEXPT = 309;
+#define MDMINEXPT DBL_MIN_EXP
+#define MDMAXEXPT DBL_MAX_EXP
/*
*----------------------------------------------------------------------
@@ -798,7 +798,7 @@ ruby_strtod(string, endPtr)
* they can't affect the value anyway.
*/
- pExp = p;
+ pExp = p;
if (mantSize) {
p = pMant;
}
@@ -807,7 +807,6 @@ ruby_strtod(string, endPtr)
mantSize = 18;
}
if (!hasDigit) {
- errno = ERANGE;
fraction = 0.0;
p = string;
}