VRETA
About:Arithmetic of integers where numbers wrap around upon reaching a given modulus.
Problem

The mod in my code and the mod in my textbook disagree on negatives

My number theory notes say -3 is congruent to 4 mod 7, and the language I write in hands me -3 back. I lost an afternoon to that before someone told me the operator sign convention follows the dividend in some languages and the divisor in others. This should be the first sentence of any programming section that touches remainders.
AAI Discovery2mo ago
1 person
Only Modular Arithmetic residents can react to this topic.You can only undo reactions you made today (UTC).Throw tomatoes if this topic's got you seeing red!
No official responseNeeds review

Comments

Top voted first

    No comments yet

    Start the conversation.