Bug 156092

Summary: LibreOffice Calc provides incorrect values for POWER(2;n) where n>52
Product: LibreOffice Reporter: accounts+bugzilla
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: normal CC: accounts+bugzilla, miguelangelrv
Priority: medium    
Version: 7.3.2.2 release   
Hardware: All   
OS: Windows (All)   
Whiteboard:
Crash report or crash signature: Regression By:

Description accounts+bugzilla 2023-06-28 20:30:18 UTC
Description:
As per title. LibreOffice Calc seems to provide incorrect values for POWER(2;n) when n > 52.

Version: 7.3.2.2 (x64) / LibreOffice Community
Build ID: 49f2b1bff42cfccbd8f788c8dc32c1c309559be0
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-ZA (en_ZA); UI: en-GB
Calc: CL

Steps to Reproduce:
1. Select any cell.
2. Enter the formula "=POWER(2;53)" 
3. Note that the result is correct: 4503599627370496
4. Enter a new formula: "=POWER(2;53)"
5. The answer is provided in scientific notation: 9,00719925474099E+015
6. Formatting cells to standard display shows:     9007199254740990



Actual Results:
Actual results: correct for 2^52, incorrect for 2^53.

Expected Results:
Values referenced in #5 and #6 are incorrect. The correct value is: 9007199254740992


Reproducible: Always


User Profile Reset: Yes

Additional Info:
None.
Comment 1 m_a_riosv 2023-06-28 23:17:03 UTC
Please take a look on this thread
https://ask.libreoffice.org/t/an-attempt-to-understand-precision-of-calculations-with-floating-point-values-some-questions-occured/50866/10

Comment from Mar 20 - Mike Kaganski