in reply to Re^2: Rounding
in thread Rounding

No, it does not.
I ran
$r = 1.3; print $r,"\n"; $rounded=sprintf ("%.1f",$r+.05); print $rounded,"\n";
and got
perl -w round.pl 1.3 1.4
Did you miss a 0 after the decimal? or is there some other behaviour I a missing.

Replies are listed 'Best First'.
Re: Re: Re^2: Rounding
by fglock (Vicar) on Sep 23, 2002 at 14:11 UTC
    If you look a bit further,  1.4 + 0.05 prints as 1.4, not 1.5
Re^4: Rounding
by Aristotle (Chancellor) on Sep 23, 2002 at 17:06 UTC
    Argh. Sorry, was in a hurry and read to carelessly and then didn't notice the extra 0 even after tripplechecking - I didn't think anyone could be that stupid. Turns out my instinct was right, and you were too. Sorry again.

    Makeshifts last the longest.