summaryrefslogtreecommitdiff
path: root/util.c
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
commitb12d61b308e9ff8a4ee0020221ebcc46b415c501 (patch)
tree5d6158165d140a352c7698823f2b748ef27b90ed /util.c
parent2d63b2b50e0f47ae32272739c537205ce30f88bd (diff)
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r--util.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/util.c b/util.c
index 42ab81039b..1b60948502 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;
}