I\'m looking for a method that can round a number up to the nearest multiple of another. This is similar Quantization.
Eg. If I want to round 81 up to the
Lee's answer is good but it should have been:
t = m + n - 1; return (t - (t % m));
Notice the change from N to M. The modulo operation should be done with the multiplier (m) and not with the number (n).
N
M
(m)
(n)