Description: ROUNDUP and ROUNDDOWN Function may not match when Count Section is zero or omitted. Steps to Reproduce: 1. Open New Calc 2. Input =ROUNDDOWN(100000000000.9 ; 0) or =ROUNDUP(100000000000.1 ; 0) Actual Results: 3. =ROUNDDOWN(100000000000.9 ; 0) -> 100000000001 =ROUNDUP(100000000000.1 ; 0) -> 100000000000 Expected Results: 3. =ROUNDDOWN(100000000000.9 ; 0) -> 100000000000 =ROUNDUP(100000000000.1 ; 0) -> 100000000001 Reproducible: Always User Profile Reset: No Additional Info: The following is a comparison between the case of zero and omitted. =ROUNDDOWN(100000000000.9 ; 0) -> 100000000001 =ROUNDDOWN(100000000000.9) -> 100000000000 =ROUNDUP(100000000000.1 ; 0) -> 100000000000 =ROUNDUP(100000000000.1) -> 100000000001 --- Reference help https://help.libreoffice.org/7.5/en-US/text/scalc/01/04060106.html ROUNDUP If Count is omitted or zero, the function rounds up to an integer. --- Even if there is a problem with accuracy, it must be the same value in this case. It looks correct if the Count Section is omitted. --- Version: 7.5.2.2 (X86_64) / LibreOffice Community Build ID: 53bb9681a964705cf672590721dbc85eb4d0c3a2 CPU threads: 4; OS: Windows 10.0 Build 10240; UI render: Skia/Raster; VCL: win Locale: ja-JP (ja_JP); UI: ja-JP Calc: threaded Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: fc6806c4be8585ce0d35a6b581bf8b3dbf858500 CPU threads: 4; OS: Windows 10.0 Build 10240; UI render: default; VCL: win Locale: ja-JP (ja_JP); UI: ja-JP Calc: threaded
*** This bug has been marked as a duplicate of bug 154792 ***
=ROUNDUP(1000000000000001) -> 1000000000000001 =ROUNDUP(1000000000000001,0) -> 1000000000000001 =ROUNDUP(1000000000000001,-1) -> 1000000000000010 =ROUNDUP(1000000000000001,-2) -> 1000000000000100 =ROUNDUP(1000000000000001,-3) -> 1000000000001000 =ROUNDUP(1000000000000001,-4) -> 1000000000000000 -- ? =ROUNDUP(1000000000000005,-4) -> 1000000000010000 =ROUNDUP(100000000000001,-4) -> 100000000010000
(In reply to nobu from comment #2) > =ROUNDUP(1000000000000001) -> 1000000000000001 > =ROUNDUP(1000000000000001,0) -> 1000000000000001 > =ROUNDUP(1000000000000001,-1) -> 1000000000000010 > =ROUNDUP(1000000000000001,-2) -> 1000000000000100 > =ROUNDUP(1000000000000001,-3) -> 1000000000001000 > =ROUNDUP(1000000000000001,-4) -> 1000000000000000 -- ? > > =ROUNDUP(1000000000000005,-4) -> 1000000000010000 > > =ROUNDUP(100000000000001,-4) -> 100000000010000 I posted it again by mistake. The following is correct. =ROUNDUP(1000000000000001) -> 1000000000000001 =ROUNDUP(1000000000000001;0) -> 1000000000000001 =ROUNDUP(1000000000000001;-1) -> 1000000000000010 =ROUNDUP(1000000000000001;-2) -> 1000000000000100 =ROUNDUP(1000000000000001;-3) -> 1000000000001000 =ROUNDUP(1000000000000001;-4) -> 1000000000000000 -- ? =ROUNDUP(1000000000000005;-4) -> 1000000000010000 =ROUNDUP(100000000000001;-4) -> 100000000010000
(In reply to nobu from comment #3) > =ROUNDUP(1000000000000001;-4) -> 1000000000000000 -- ? More than 15 positions. See https://wiki.documentfoundation.org/Faq/Calc/Accuracy https://help.libreoffice.org/latest/en-US/text/scalc/01/calculation_accuracy.html
I marked this as a dupe for a purpose, because it is a duplicate of bug 154792. You removed yourself from CC list there, but obviously didn't read bug 154792 comment 2, which explains why the small differences are tolerated there (using approxFloor for ROUNDDOWN, and approxCeil for ROUNDUP, respectively).
And it's not specific to omitting the second argument - just use 0, or any other value, and you get lots of similar results.
(In reply comment #5) > You removed yourself from CC list there, @nobu, there are news for you in bug 154792, among others. You shouldn't have un-cc'ed :).