https://bugs.documentfoundation.org/show_bug.cgi?id=93408
Eike Rathke <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |[email protected]
Resolution|--- |WONTFIX
--- Comment #2 from Eike Rathke <[email protected]> ---
As usual, this is due to binary representation of floating point values. 2.2
and 0.1 have no exact representation and are more like 2.2000000000000002 and
0.10000000000000001 which add up to 2.3000000000000003; 1.15 is more like
1.1499999999999999 so the division result in C2 is 2.0000000000000004 and the
subtraction result is -1.0000000000000004, which is an invalid argument to
ACOS().
In cell C3 the division is around 2.2999999999999998 / 1.1499999999999999 with
result 2, so 1-2=-1 is a good argument to ACOS().
Btw, Excel and Gnumeric show the same behavior.
We likely won't "fix" this.
To prevent this problem values have to be rounded at strategic places, e.g. in
cell B2 instead of =A2+0.1 use =ROUND(A2+0.1,1) or round only the argument in
cell C2 according to the expected decimals =ACOS(ROUND(1-B2/C1,2)), or even
rounding to 12 decimals will work in this case. Your mileage may vary..
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs