No. Perl and ikegami are correct.
If your logic is what I think it is, you're doing something like this:
2.6745508 -> 2.676 2.676 -> 2.68
This is wrong: rounding is not done in stages. In this case, the entire expansion to the right of the hundredths place is processed together. In other words, for your case, you round based on 45508.
emc
At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.
—Igor Sikorsky, reported in AOPA Pilot magazine February 2003.In reply to Re: sprintf and decimals
by swampyankee
in thread sprintf and decimals
by nosbod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |