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

            Bug ID: 154871
           Summary: ROUNDDOWN returns invalid results when working with
                    larger numbers
           Product: LibreOffice
           Version: 7.4.5.1 release
          Hardware: All
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: brianjheis...@gmail.com

Example I:

A1 =28147497671265.2
A2 =ROUNDDOWN(A1,-2)
A3 =ROUNDDOWN(A1,0)
A4 =ROUNDDOWN(A1,2)

The result in A2 should be 28147497671200 but it is instead 28147497671300.
The result in A3 should be 28147497671265 but it is instead 28147497671300.
The result in A4 should be 28147497671265 but it is instead 28147497671300.

====

Example II:

B1 =2814749767126.2
B2 =ROUNDDOWN(($B$1),-2)
B3 =ROUNDDOWN(($B$1),0)
B4 =ROUNDDOWN(($B$1),2)

The result in B2 should be 2814749767100 and it is.
The result in B3 should be 2814749767126 but it is instead 2814749767130.
The result in B4 should be 2814749767126 but it is instead 2814749767130.

====

I may be wrong but I suspect some kind of disconnect between Calc's IEEE 754
Double and the mechanics of the ROUNDDOWN function because as I experiment with
different values, closing in on operands requiring no more than 32-bits for
representation sees this problem fade away.

IEEE 754 Double should give us 15 digits (and sometimes, 16 digits) of
precision in the significand.

====

Version: 7.4.5.1 (x64) / LibreOffice Community
Build ID: 9c0871452b3918c1019dde9bfac75448afc4b57f
CPU threads: 8; OS: Windows 6.1 Service Pack 1 Build 7601; UI render:
Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL

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

Reply via email to