in reply to OT: Integer rounding?
Update:
Doing it by hand, I'd do:
sub round_to_nearest { my ($n, $scale) = @_; int(($n + $scale/2)/$scale) * $scale; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: OT: Integer rounding?
by flyingmoose (Priest) on Mar 22, 2004 at 21:43 UTC |