Should % ever "overflow"?

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Sun Jun 26 02:35:22 PDT 2016


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



More information about the Digitalmars-d mailing list