sub fix2 { my $n = shift; # must be greater or equal to this (assert >= 0) my $m = shift; # must be multiple of this (assert > 0) $n + ($m-$n)%$m; }
In reply to Re: Best way to make sure a number is an even multiple of another?
by Roy Johnson
in thread Best way to make sure a number is an even multiple of another?
by demerphq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |