[interchange-bugs] [rt.icdevgroup.org #349] Vend::Util::round_to_frac_digits() simplification

Mark Overmeer via RT interchange at rt.icdevgroup.org
Wed Mar 21 11:43:34 UTC 2012


<URL: http://rt.icdevgroup.org/Ticket/Display.html?id=349 >

> As was just discussed with Mike on the mailing list, rounding with
> sprintf (indeed any rounding that relies on floating point arithmetic)
> has issues with floating point errors and should not be relied upon.  I
> think it's best to just fix the issues pointed out with the current
> function.

Anyone running with 32bit floats then?  With 64bit floats you have 15 digits.  Adding 0.001 leaves 12 before the dot, resulting in a chance on rounding errors when your turnover is as large as the American national dept.



More information about the interchange-bugs mailing list