Update:
Doing it by hand, I'd do:
sub round_to_nearest { my ($n, $scale) = @_; int(($n + $scale/2)/$scale) * $scale; }
In reply to Re: OT: Integer rounding?
by Roy Johnson
in thread OT: Integer rounding?
by Ryszard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |