diff options
author | unknown <monty@mysql.com> | 2004-03-15 13:21:14 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-03-15 13:21:14 +0200 |
commit | 33fc9c3c9e4dd3c7dc02aa4fef8215fc63db1120 (patch) | |
tree | b9da4e380a51380a2fddff767d877467eaae81fb /strings | |
parent | e91c5cd018614710385e0f154976eb934876b63d (diff) | |
parent | e18db6152fe3b25c316e6ab5d1459c478a57e579 (diff) | |
download | mariadb-git-33fc9c3c9e4dd3c7dc02aa4fef8215fc63db1120.tar.gz |
merge & simple cleanup
Diffstat (limited to 'strings')
-rw-r--r-- | strings/strtod.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/strings/strtod.c b/strings/strtod.c index 243322cb945..92a4700cfc4 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; @@ -92,10 +97,10 @@ double my_strtod(const char *str, char **end) } if (exp >= 1000) { - if (neg) - result= 0.0; - else - overflow=1; + if (neg) + result= 0.0; + else + overflow= 1; goto done; } while (exp >= 100) @@ -115,10 +120,10 @@ done: if (end) *end = (char *)str; - if (overflow || ((overflow=isinf(result)))) + if (overflow || isinf(result)) { - result=DBL_MAX; - errno=EOVERFLOW; + result= DBL_MAX; + errno= EOVERFLOW; } return negative ? -result : result; |