Topic was automatically imported from the old Question2Answer platform.
Asked By
gdnc
When I do something like (-1) % 20, I expect the result to be 19, but i’m getting -1 instead. Is there another syntax I should be using to get modular arithmetic that restricts the range to positive numbers less than the thing I’m dividing by?