#At file:///home/hf/work/mysql_common/36829/ based on
revid:holyfoot@stripped
2940 Alexey Botchkov 2009-11-05
Bug#36829 Decimal to double conversion is inaccurate
it's the 'string to double' conversion that isn't accurate here.
if we use 'long double' instead of the 'double' to accumulate the
result, the precision isn't lost.
The 'double to string' conversion still isn't fixed in this case, but
that's how it was in 4.0
per-file comments:
strings/strtod.c
Bug#36829 Decimal to double conversion is inaccurate
long double used to accumulate the result
modified:
strings/strtod.c
=== modified file 'strings/strtod.c'
--- a/strings/strtod.c 2007-08-13 13:11:25 +0000
+++ b/strings/strtod.c 2009-11-05 07:25:48 +0000
@@ -85,7 +85,7 @@ const double log_10[] = {
double my_strtod(const char *str, char **end_ptr, int *error)
{
- double result= 0.0;
+ long double result= 0.0;
uint negative= 0, neg_exp= 0;
size_t ndigits, dec_digits= 0;
int exponent= 0, digits_after_dec_point= 0, tmp_exp, step;
Attachment: [text/bzr-bundle] bzr/holyfoot@mysql.com-20091105072548-bmj74pv4mqdnt3tw.bundle
| Thread |
|---|
| • bzr commit into mysql-5.5-next-mr-bugfixing branch (holyfoot:2940)Bug#36829 | Alexey Botchkov | 5 Nov 2009 |