summaryrefslogtreecommitdiff
path: root/strings/strtod.c
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-03-15 12:53:27 +0200
committermonty@mysql.com <>2004-03-15 12:53:27 +0200
commitcf66e187e2fc3bd7c27d5f1bfe658613238498f1 (patch)
treeaedea5470f7681cfb53ee4f2a9bda9dbf2859aaa /strings/strtod.c
parent42c19ada564ad6b9f94ea5aefd9371e845b8f18f (diff)
downloadmariadb-git-cf66e187e2fc3bd7c27d5f1bfe658613238498f1.tar.gz
Optimizations
Diffstat (limited to 'strings/strtod.c')
-rw-r--r--strings/strtod.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/strings/strtod.c b/strings/strtod.c
index a06b74248cb..4c3f31bc00c 100644
--- a/strings/strtod.c
+++ b/strings/strtod.c
@@ -36,6 +36,11 @@ static double scaler1[] = {
1.0, 10.0, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9
};
+
+#ifndef HUGE_VAL /* Should be +Infinitive */
+#define HUGE_VAL DBL_MAX
+#endif
+
double my_strtod(const char *str, char **end)
{
double result= 0.0;
@@ -90,10 +95,7 @@ double my_strtod(const char *str, char **end)
}
if (exp >= 1000)
{
- if (neg)
- result= 0.0;
- else
- result= DBL_MAX*10;
+ result= neg ? 0.0 : HUGE_VAL;
goto done;
}
while (exp >= 100)