diff options
author | unknown <kaa@polly.local> | 2007-05-28 21:43:31 +0400 |
---|---|---|
committer | unknown <kaa@polly.local> | 2007-05-28 21:43:31 +0400 |
commit | eab7e4d4e4375aa68996908ab391d3fd6b621ff3 (patch) | |
tree | 6491aa3127abe984ce1291b8a2128cab295fc4b2 /strings | |
parent | 088cb9ddc41b7dfb8d6ff3c92d949c326dcaabb1 (diff) | |
download | mariadb-git-eab7e4d4e4375aa68996908ab391d3fd6b621ff3.tar.gz |
Don't use log_01[] in my_strtod() to avoid loss of precision.
This is for bug #28121.
strings/strtod.c:
Don't use log_01[] in my_strtod() to avoid loss of precision.
Diffstat (limited to 'strings')
-rw-r--r-- | strings/strtod.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/strings/strtod.c b/strings/strtod.c index 2d807520d77..a1799dd748b 100644 --- a/strings/strtod.c +++ b/strings/strtod.c @@ -244,8 +244,8 @@ double my_strtod(const char *str, char **end_ptr, int *error) else step= array_elements(log_10) - 1; for (; exponent > step; exponent-= step) - result*= neg_exp ? log_01[step] : log_10[step]; - result*= neg_exp ? log_01[exponent] : log_10[exponent]; + result= neg_exp ? result / log_10[step] : result * log_10[step]; + result= neg_exp ? result / log_10[exponent] : result * log_10[exponent]; } done: |