Re: RE: follow up II - newbie questions, sum over range, rounding of special problematic values

Steven D'Aprano <[email protected]> Sun, 23 May 2021 10:29:05 +1000
Newsgroups gmane.comp.gnome.apps.gnumeric
Message-ID <[email protected]>
Hi,

Do you prefer to be called "nullzwei" or "b"?

I think that your issue is that you believe that roundup and rounddown 
do not behave correctly, if that correct?

You have the value:

0.24999999999999997

and rounddown(0.24999999999999997, 16) returns 0.25 exactly, which is 
larger than the original input.

Also roundup(0.24999999999999997, 16) returns 0.2499999999999999, which 
is smaller than the original input.

You expected the opposite results:

rounddown(0.24999999999999997, 16) --> 0.2499999999999999
(but actually got 0.25)

roundup(0.24999999999999997, 16) --> 0.25
(but actually got 0.2499999999999999)

Do you agree that this is a good description of the problem?



-- 
Steve