Python, unlike C, has the mod operator always return a positive number
Doesn’t C just do whatever the underlying hardware does for modulo w negative numbers? I have always worked around this by adding N to numerator:    r = (i + N) % N

which handles cases where i >= -N which is mostly what I run into when i is negative.I remember Ada having two different operators REM and MOD which I think is the best language choice.