Created
July 1, 2017 14:12
-
-
Save banjeremy/94f4a4d00cbb79a5477f5f5f60a61372 to your computer and use it in GitHub Desktop.
proper modulo on negative numbers
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
def mod(m: Int, n: Int) = ((m % n) + n) % n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment