https://bugs.documentfoundation.org/show_bug.cgi?id=165738
Bug ID: 165738
Summary: Round inside functions
Product: LibreOffice
Version: 25.2.1.2 release
Hardware: All
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: LibreOffice
Assignee: [email protected]
Reporter: [email protected]
Description:
I encountered some unexpected behavior in LibreOffice—using numbers in
functions and arithmetic operations rounds them after a certain decimal place.
For example, the result of the multiplication =0.6 * 3 will be 1.8 in the cell
and in the file, which differs from the result of the calculation in Python,
1.7999999999999998. Additionally, if I use large numbers inside formulas, the
result will be rounded. For instance, the result of the comparison
=CLEAN(1.7999999999999998) = CLEAN(0.6 * 3) will be TRUE, and the formula will
change to =CLEAN(1.8) = CLEAN(0.6 * 3). However, =CLEAN(1.79999999999998) =
CLEAN(0.6 * 3) will return FALSE and will not alter the formula. Is this
behavior a bug, or is rounding after a certain decimal place supposed to happen
in arithmetic operations and functions?
Steps to Reproduce:
1. Enter used formulas in any cell
Actual Results:
=1.7999999999999991 = 1.7999999999999999 - TRUE
=CLEAN(1.7999999999999991) - 1.8
=CLEAN(1.799999999999991) - 1.79999999999999
Expected Results:
=1.7999999999999991 = 1.7999999999999999 - FALSE
=CLEAN(1.7999999999999991) - 1.7999999999999991
=CLEAN(1.799999999999991) - 1.799999999999991
Reproducible: Always
User Profile Reset: No
Additional Info:
Used formulas:
=1.7999999999999991 = 1.7999999999999999
=0.6*3
=10.01-10
=1234567890 + 0.0123456789
=CLEAN(1.7999999999999991)
=CLEAN(1.799999999999991)
=CLEAN(1.79999999999991)
=CLEAN(0.6*3)
=TRUNC(0.6*3,15)
=TRUNC(1.7999999999999998, 15)
=TRUNC(1.799999999999998, 15)
=TRUNC(1.79999999999998, 15)
=CLEAN(1.7999999999999998) = CLEAN(0.6*3)
=CLEAN(1.79999999999998) = CLEAN(0.6*3)
--
You are receiving this mail because:
You are the assignee for the bug.