Yikes. In #python, (-7) % 4 == 1 but Decimal(-7) % Decimal(4) == Decimal('-3'). That's really confusing.