https://bugs.documentfoundation.org/show_bug.cgi?id=174261
Bug ID: 174261
Summary: FILESAVE XLSX: numbers saved with only 15 significant
digits, so values change on round-trip
Product: LibreOffice
Version: 26.8.2.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Calc
Assignee: [email protected]
Reporter: [email protected]
Steps to reproduce:
1. New spreadsheet. A1: =0.1+0.2. A2: =1/3
2. Save as .xlsx and look at xl/worksheets/sheet1.xml (or reload the file).
Actual result:
A1 is saved as 0.3 and A2 as 0.333333333333333 - different doubles from the
ones in the document (0.30000000000000004 and 0.3333333333333333). Comparisons
against the reloaded values (=A1=0.1+0.2, lookups, COUNTIF) then give different
answers.
Expected result:
Values read back as the identical double. Excel writes up to 17 significant
digits (shortest exact form), e.g. 0.30000000000000004.
Measured on 500,000 random doubles round-tripped xlsx -> xlsx: LibreOffice
26.8.2 changed 447,375 of them; with the patch all 500,000 read back exactly,
with no measurable change in save time.
Tested: LibreOffice 26.8.2 (Linux) and current master. Patch to follow on
Gerrit.
--
You are receiving this mail because:
You are the assignee for the bug.