Apache OpenOffice (AOO) Bugzilla – Issue 102054
Substraction error
Last modified: 2013-01-29 21:52:38 UTC
=400000000000001-400000000000000 returns 0
I think, OOo should be more accurate, when the arguments are pure integral numbers. As far as I see, in interpr5.cxx the function approxSub is used for subtracting in all cases. This calls approxEqual, which forces the result to zero, if the difference is in the last three bits. I am right? If yes, I suggest to make a case distinction whether the values are pure integral numbers or not and use a simple minus, when both are pure integral numbers. As far as I know, IEEE double is accurate up to the last bit in adding, subtracting and multiplying, in the range of integral numbers. Why should OOo intentially reduce accuracy?