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)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2013-02-26 15:28 UTC by lo_bugs
Modified: 2018-09-02 05:19 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

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?

https://en.wikipedia.org/wiki/IEEE-754#Roundings_to_nearest
https://en.wikipedia.org/wiki/Rounding#Round_half_to_even

Example:
=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

https://opengrok.libreoffice.org/s?refs=rtl_math_RoundingMode_HalfEven&project=core