Bug 168277 - Wrong Round result if rounding a specific formula (100-ROUND(MROUND()))
Summary: Wrong Round result if rounding a specific formula (100-ROUND(MROUND()))
Status: RESOLVED DUPLICATE of bug 128312
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-04 10:33 UTC by Orwel
Modified: 2025-09-05 01:19 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
test file (20.47 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-09-04 10:34 UTC, Orwel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Orwel 2025-09-04 10:33:57 UTC
Description:
When I use a specific formula containing (100-ROUND(MROUND())) with specific values, I get a wrong result.
I cannot reproduce the bug with other initial data, so the exact numbers used to reproduce the bug should be used (see also attached file). 

Steps to Reproduce:
1. SET: A1 = 79, C1 = 124, B1=MROUND((C1+A1/4+A1)/2;2)
2. SET: B2=ROUND(B1*100/C1;2) 
3. SET: B3=100-ROUND(B1*100/C1;2) / C3 =100-B2 
4. TO SEE THE WRONG RESULTS, B2:C3 should be set to MAXIMUM SHOWED DECIMAL PLACES (icon .00+).

The reproduced steps can also be seen in the attached file.

Actual Results:
B2 = CORRECT OUTPUT (90,32)
B3, C3 = WRONG OUTPUT (9,6800000000000100 instead of 9,68)

Expected Results:
B3,C3 = CORRECT OUTPUT (90,32)


Reproducible: Always


User Profile Reset: No

Additional Info:
This only happens when using '100-' in the formula of B3/C3. It does not happen if you use a different number (e.g. 10-, 1000-,...).
I also cannot reproduce the incorrect result by entering different numbers in cells A1 and C1 (I tried a few); it is probably due to a specific result of the division in B2.

Version: 25.2.3.2 (X86_64) / LibreOffice Community
Build ID: bbb074479178df812d175f709636b368952c2ce3
CPU threads: 16; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/
Comment 1 Orwel 2025-09-04 10:34:51 UTC
Created attachment 202690 [details]
test file
Comment 3 fpy 2025-09-05 01:19:13 UTC
samme, same, ...

https://ask.libreoffice.org/t/45-95-46-57-0-619999999999997-should-be-0-62-exactly-no-rounding/125709

*** This bug has been marked as a duplicate of bug 128312 ***