https://bugs.documentfoundation.org/show_bug.cgi?id=155646

            Bug ID: 155646
           Summary: Decimal calculations are subject to binary float error
           Product: LibreOffice
           Version: unspecified
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

In any cell in LibreOffice enter the following formula =1475.99-1440.32 and
observe the output.
Expected: 35.67
Actual: 35.6700000000001
It appears LibreOffice is subject to the float errors found in primitive data
types in most programming languages. As a Java developer I am aware of this
float issue and how in Java BigDecimal is used for accurate decimal
calculations. However in a spreadsheet I would expect accurate decimal
calculation by default and this is the case with tools like excel or google
sheets.
Even worse is that if I change the cell format to currency I still observe this
float error. It is worse as currency typically should be using accurate decimal
calculations, I cannot think of a case when currency should use binary float
types.
The version of LibreOffice calc I have tested is 7.5.3.2.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to