Modulo operation please

No what I mean is you need this:

mod = x
mod /= y
mod -= floor mod
mod *= y
mod = round mod

Otherwise the function will return wrong (not-integer) results for non-power of two Ys.

5 Likes