in reply to Re^2: Best way to make sure a number is an even multiple of another?
in thread Best way to make sure a number is an even multiple of another?
So, I want an easy, reliable way to add a multiple ($i) of $m so that $i - $n >= 0. The exact number doesn't matter, as
for any non-negative integers $r and $s, and positive integer $m.($r*$m + $s) % $m == $s % $m
$m*$n is both a multiple of $m, and at least as large as $n.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Best way to make sure a number is an even multiple of another?
by Roy Johnson (Monsignor) on Oct 21, 2004 at 16:39 UTC | |
by hv (Prior) on Oct 22, 2004 at 10:44 UTC |