Re: [xslt] floating point conversion

On Sat, Sep 11, 2010 at 03:55:46PM -0400, Phil Shafer wrote:
> Vincent Lefevre writes:
> >I fear that's not sufficient. A few lines above, the multiplications
> >by 10 and additions introduce rounding errors for 17 digits and more.
> >An integer just below a rounding boundary will probably not be rounded
> >correctly.
> [repeating my bugzilla comment]
> We can just use strtod(), which handle both my fractional issue and
> your big number issue perfectly.  Unless there are objections, I'll
> redo the patch on Monday.

  and repeating my bugzilla comment here too, the problem is that
strtod is locale dependant and really 1/ can allow deviation 2/
switch locale from the library at each call , so fixing this is really
a matter of writing down equivalent code but limiting the roundings.
(<grin/> it's not fun)


Daniel Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine | virtualization library

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]