Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Actually, this isn't quite the whole story. Most everyone follows the IEEE convention of "round towards nearest or even."
Examples (rounding all of these to the one's place):
2.51 becomes 3 (this is the 'nearest' rule, which always comes first) However, what happens if you have 2.50 ? Which way do you round it... 'tis no nearer to 2 than to 3. The IEEE standard says if there is a tie, round to the even number.
2.50 becomes 2 You have to pick up or down... this method is consistent and thus tends to make your errors (statistically) smaller. In reply to Re: Re: Re: Using (s)printf()
by Anonymous Monk
|
|