Last active
May 18, 2018 22:33
-
-
Save treeform/51db7a31b1bb64daf5bdb662a9b8e6c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc pythonMod(n, M: int): int = ((n mod M) + M) mod M | |
assert pythonMod(1, -4) == -3 | |
assert pythonMod(-1, 4) == 3 | |
assert pythonMod(-1, -4) == -1 | |
assert pythonMod(1, 4) == 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment