% operator incorrect for large negative integers
s-cork opened this issue · comments
e.g.
>>> x = -int('1' * 100)
>>> x%4
# skulpt says -3
1
This is because of the difference between the % operator in javascript vs python
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder
It shouldn't be too difficult to fix.
Inside the scope of a related pr might be to add test_long.py
from cpython (we don't currently include it)
Adding it will likely expose some other int related bugs 😬