On Sunday, 26 June 2016 at 00:54:04 UTC, Guillaume Boucher wrote:
If division truncates towards negative infinity, the remainder will always be nonegative (in case of a positive divisor).

Or even better, use euclidean division, then the reminder always remains non-negative:

https://en.wikipedia.org/wiki/Euclidean_division

Reply via email to