# Re: sprintf rouding error

• From: Joost Diepenmaat <joost@xxxxxxxxx>
• Date: Tue, 22 Jan 2008 11:42:25 +0100

Alex <check.sig@xxxxxxxxxxxxxxxxx> writes:

Peter Makholm wrote:
Alex <check.sig@xxxxxxxxxxxxxxxxx> writes:
Going a little bit off topic, but I gots to know... When is 6704 the
correct rounding of 6704.5 and why??? Or was it merely a typo?

Isn't that explained on
http://en.wikipedia.org/wiki/Rounding
under 'Round-to-even method'?

Well, yes (and I confess I didn't even read so far at first), but
given no context at all, I'm fairly certain that mathematical rounding
defaults to the common method, which yields 6705. At least, this is
how I was taught in school.

I was also taught this rule in school. I am pretty certain round-to-even
is more common at least for statistical calculations.

From that wiki page:

History

The Round-to-even method has been the ASTM (E-29) standard since
1940. The origin of the terms unbiased rounding and statistician's
rounding are fairly self-explanatory. In the 1906 4th edition of
Probability and Theory of Errors [1] Robert Woodward called this "the
computer's rule" indicating that it was then in common use by human
computers who calculated mathematical tables. Churchill Eisenhart's 1947
paper "Effects of Rounding or Grouping Data" (in Selected Techniques of
Statistical Analysis, McGrawHill, 1947, Eisenhart, Hastay, and Wallis,
editors) indicated that the practice was already "well established" in
data analysis.

Joost.
.

## Relevant Pages

• Re: sprintf rouding error
... how I was taught in school. ... is more common at least for statistical calculations. ... The OP stated clearly that rounding 6704.5 down was an error, ... reasoning behind this unexpected rounding. ...
(comp.lang.perl.misc)
• Re: sprintf rouding error
... What about the IEEE rounding and Perl...is it a fact that the ... "uncorrectness" with floating point conversion leads to the ... is more common at least for statistical calculations. ...
(comp.lang.perl.misc)
• Re: mesa & rounding
... And what type of rounding do they use? ... wikepedia has a reasonably good explanation of the most common ... I suspect ComputerShare uses the round to even method. ... Unfortunately, mesa does not have this as a built in function, but it can ...
(comp.os.os2.apps)
• Re: "bankers rounding"
... >Does anyone here even know of someone who actually prefers VB to do "Banker's Rounding"? ... >Maybe even common. ... - and they would have screamed if I had used 'Bankers Rounding' ... Prev by Date: ...
(microsoft.public.vb.general.discussion)