Apache OpenOffice (AOO) Bugzilla – Issue 59153
MOD() returns negative values for large input
Last modified: 2017-05-20 11:41:42 UTC
Found when testing issue 59112 "Off-by-one calculation int() and floor() with large inputs". May be related. MOD(293045370521579;5) returns -1 rather than 4.
Confirm OOo 2.0.0 Windows.
Hi Eike, yours ? Frank
Accepted. The input value seems to be on the very border of representable accuracy..
Can't schedule in time frame, retargeting to OOo2.0.4.
Won't make it in timeframe for 2.0.4, retargeting to OOo2.x
The values are calculated with approx-routines. That is necessary for decimal inputs. But we can calculate the remainder directly, when input is a pure integral number. This gives a better accuracy then. I'll attach patch and test-cases.
Created attachment 61733 [details] Testcases, that show that accuracy can be better for pure integral numbers
Created attachment 61734 [details] uses fmod in case of pure integral number in denominator
Thanks! Scheduled for inclusion in CWS odff06.
In cws odff06: revision 271397 sc/source/core/tool/interpr2.cxx
Reassigning to QA for verification.
verified in internal build cws_odff06