#modular-arithmetic

[ follow ]
JavaScript
fromMedium
3 weeks ago

Python is consistent about modular arithmetic, like Mathematica

Mainstream programming languages' % operator yields negative remainders for negative operands, producing −3 for −3 % 4 instead of the mathematically expected 1.
[ Load more ]