stringencoders
stringencoders copied to clipboard
In some cases modp_dtoa/modp_dtoa2 gives different precision then requested
Nick,
The code has the following branch:
if (value > thres_max) {
sprintf(str, "%e", neg ? -value : value);
return;
}
This is wrong as it ignores requested precision - sprintf uses 6 precision by
default.
Original issue reported on code.google.com by [email protected] on 10 Jun 2010 at 8:56
I think what is going on here is that,
"if the precision is beyond what we can print, use exponential notation"
This may be stupid. and probably should be removed so the output is consistent.
--nickg
Original comment by [email protected] on 12 Jun 2010 at 2:10
happy to have pull request to fix this.