In JavaScript the % operator seems to behave in a very weird manner. I tried the following:
>>> (0 - 11) % 12 -11
Why does it return -11 instead of 1 (as in Python)?
I am sure I am doing or expecting something wrong, but the docs don’t tell me what.
fmod from the math module behaves correctly in python:
-11 is the correct answer..