Bug 61512 - Calc ROUND() don't use default IEEE 754 method (-> statistical error).
Summary: Calc ROUND() don't use default IEEE 754 method (-> statistical error).
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected)
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
Reported: 2013-02-26 15:28 UTC by lo_bugs
Modified: 2021-05-31 14:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description lo_bugs 2013-02-26 15:28:00 UTC
Why doesn't Calc'S ROUND() use the mathematical/statistical correct rounding method that is also the default IEEE 754 standard for floating point numbers?


=ROUND(5/2) gives "3"
its should give "2" however, if it used the correct computer/statistics rounding, because on a plain ".5(0000...)" you have to round to the even number to avoid statistical errors.

More example: If you average over 1000 rounded positive half integers (-> the mean of 1000 random round(n/2) ) it will be simply wrong, because for all odd n you will round up, but it will never happen that you round down. Your mean will be to big.

That's why Calc should have a ROUND() that uses statistical/mathematical and standard correct rounding.
Comment 1 Urmas 2013-02-26 16:30:10 UTC
Because the standard 5/4 rounding is more useful for spreadsheets.
Comment 2 lo_bugs 2013-02-26 19:20:43 UTC
(In reply to comment #1)
> Because the standard 5/4 rounding is more useful for spreadsheets.

What's more "useful" is given by the use case. However, the word "useful" is not even correct here. In statistical problems, for which you can use LO Calc, the "always round up on .5" method is simply wrong, not just unuseful!

If you feel better, then take this as a simple feature request, not as a bug.

Or if you want to be more "bureaucratic": Currently LO Calc is not IEEE 754 conform (pretty bad for a computer program, IMHO), because it only has the three non-default methods of IEEE 754: round always down, round always up and round up on ".5"
But it is completly missing the IEEE 754 rounding of on .5 round to the even number (and this is even the default of IEEE 754).
Comment 3 Robinson Tryon (qubit) 2013-11-24 20:31:14 UTC
Perhaps there could be an option to select IEEE-754 mode in spreadsheets?

Marking as enhancement
Status -> NEW
Comment 4 himajin100000 2018-09-02 01:54:36 UTC
seems the enum value rtl_math_RoundingMode_HalfEven is used nowhere

Comment 5 Carla Page 2020-12-24 06:44:33 UTC Comment hidden (spam)
Comment 6 HannaCooper 2021-03-03 11:19:19 UTC Comment hidden (spam)
Comment 7 Munna 2021-04-10 12:03:57 UTC Comment hidden (spam)
Comment 8 Lina Parker 2021-05-31 14:51:49 UTC Comment hidden (spam)