Rounding [Software]
continuing our personal communication. THX for reminding me on the rule your professor in physical chemistry taught you. How could I forget this goodie?
- if the number next to the required digit ≤4, then drop it: 125.003 ⇒ 125.00
- if the number next to the required digit ≥6, then add 1 to the required digit: 125.008 ⇒ 125.01
- if the number next to the required digit =5, then
- if the required digit is odd, then add 1 to the required digit: 125.015 ⇒ 125.02
- if the required digit is even, then drop it: 125.005 ⇒ 125.00
- if the required digit is odd, then add 1 to the required digit: 125.015 ⇒ 125.02
(1) Commercial rounding:
(2) R & Maxima:
(3) Chem. rounding:
Based on the regression I would prefer (3). But the down-rounding close to 125.005 extends even further up than in R & Maxima:
(1) (2) (3)
124.9950 125.00 125.00 125.00
← rule 3.1125.0045 125.00 125.00 125.00
← rule 1125.0050 125.01 125.00 125.00
← rule 3.2125.0055 125.01 125.01 125.00
← rule 3.2125.0059 125.01 125.01 125.00
← rule 3.2125.0060 125.01 125.01 125.01
← rule 2Edit: It’s clear that we are loosing information in rounding. No big deal if we don’t introduce bias. Nice that R & Maxima use ‘rounding half to even’ which is overall (i.e., [–∞, 0, +∞]) less biased than ‘rounding half away from zero’. However bias exists – just a different one.
In our case we have positive numbers only. ‘Best’ algo?
BTW, is disturbed me somewhat that most replies at R-Help were like “R complies with the standard. Full stop.”
As soon as we abandon our own reason, and are content
to rely upon authority, there is no end to our troubles.
Bertrand Russell
A central lesson of science is that to understand complex issues
(or even simple ones), we must try to free our minds of dogma and
to guarantee the freedom to publish, to contradict, and to experiment.
Arguments from authority are unacceptable.
Carl Sagan
Anyone who conducts an argument by appealing to authority
is not using his intelligence;
he is just using his memory.
Leonardo da Vinci
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
![[image]](https://static.bebac.at/pics/Blue_and_yellow_ribbon_UA.png)
Helmut Schütz
![[image]](https://static.bebac.at/img/CC by.png)
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- Rounding Helmut 2013-01-01 16:51
- Rounding d_labes 2013-01-02 12:51
- Rounding Helmut 2013-01-04 17:35
- Rounding d_labes 2013-01-05 19:25
- Rounding Helmut 2013-01-05 20:13
- Sim’s are sim’s are sim’s d_labes 2013-01-05 20:57
- Another vicious circle Helmut 2013-01-06 02:21
- Where all these numbers came from? d_labes 2013-01-07 15:52
- Flaw in the GL? Helmut 2013-01-07 17:29
- Flaw in the GL? d_labes 2013-01-08 11:44
- What a mess! Helmut 2013-01-08 19:08
- What a mess! d_labes 2013-01-09 10:33
- What a mess! Helmut 2013-01-09 15:18
- What a mess! d_labes 2013-01-09 10:33
- What a mess! Helmut 2013-01-08 19:08
- Flaw in the GL? d_labes 2013-01-08 11:44
- Flaw in the GL? Helmut 2013-01-07 17:29
- Where all these numbers came from? d_labes 2013-01-07 15:52
- Rounding Helmut 2013-01-05 20:13
- Rounding d_labes 2013-01-05 19:25
- Rounding Helmut 2013-01-04 17:35
- Rounding ElMaestro 2013-01-02 16:12
- Abandon rounding Helmut 2013-01-02 17:04
- Rounding yjlee168 2013-01-05 23:15
- Rounding d_labes 2013-01-02 12:51