This file contains hidden or 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
# Some modular arithmetic helper methods useful for number theory or | |
# cryptography. | |
# | |
# # Examples | |
# | |
# Compute the greatest common denominator of 114 and 48: | |
# | |
# gcd(114, 48) #=> 6 | |
# | |
# Compute `a` and `b` such that `a*x + b*y = gcd(x, y)`: |