diff options
author | unknown <kaa@polly.local> | 2006-11-14 16:38:11 +0300 |
---|---|---|
committer | unknown <kaa@polly.local> | 2006-11-14 16:38:11 +0300 |
commit | a63413b8135fdcf8aea1b11389c54a0bf6375ac3 (patch) | |
tree | eb674c86787457dbfe73928f6c5415b14de901a9 /strings | |
parent | c21f4e6e4c1da4e7affdfd03de526c72983c612a (diff) | |
parent | a4e945600e37cde6191f014774cdacf739a0faa4 (diff) | |
download | mariadb-git-a63413b8135fdcf8aea1b11389c54a0bf6375ac3.tar.gz |
Merge polly.local:/tmp/maint/bug22129/my50-bug22129
into polly.local:/home/kaa/src/maint/mysql-5.0-maint
Diffstat (limited to 'strings')
-rw-r--r-- | strings/strtod.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/strings/strtod.c b/strings/strtod.c index ddb570718a0..932a34f921d 100644 --- a/strings/strtod.c +++ b/strings/strtod.c @@ -31,7 +31,6 @@ #define MAX_DBL_EXP 308 #define MAX_RESULT_FOR_MAX_EXP 1.7976931348623157 -#define MIN_RESULT_FOR_MIN_EXP 2.225073858507202 static double scaler10[] = { 1.0, 1e10, 1e20, 1e30, 1e40, 1e50, 1e60, 1e70, 1e80, 1e90 }; @@ -161,26 +160,15 @@ double my_strtod(const char *str, char **end_ptr, int *error) order= exp + (neg_exp ? -1 : 1) * (ndigits - 1); if (order < 0) order= -order; - if (order >= MAX_DBL_EXP && result) + if (order >= MAX_DBL_EXP && !neg_exp && result) { double c; /* Compute modulus of C (see comment above) */ c= result / scaler * 10.0; - if (neg_exp) + if (order > MAX_DBL_EXP || c > MAX_RESULT_FOR_MAX_EXP) { - if (order > MAX_DBL_EXP || c < MIN_RESULT_FOR_MIN_EXP) - { - result= 0.0; - goto done; - } - } - else - { - if (order > MAX_DBL_EXP || c > MAX_RESULT_FOR_MAX_EXP) - { - overflow= 1; - goto done; - } + overflow= 1; + goto done; } } |