Created attachment 117887 [details] Spreadsheet attached to demonstrate the bug Problem Description Value of Cell C1 is 1.15 Value of Cell A2 is 2.2 Cell B2 is A2+0.1 (Value = 2.3) Value of Cell B3 is 2.3 Cell C2 = ACOS(1-B2/C1) i.e. ACOS(-1) it should return 3.14159... Returns #VALUE! Cell C3 = ACOS(1-B3/C1) i.e. ACOS(-1) Returns 3.14159... correctly. Typing "2.3" in Cell B2 returns 3.14159 in cell C2 correctly. Tested on following Mac OS X with LibreOffice 5.0.0.5 Windows 7 with LibreOffice 4.4.0.3 Both have same bug.
Confirming on LO 5.0.0.2 OSX 10.10.4
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..