Module math

Source

Functions§

extended_gcd
Finds an extended GCD (Greatest Common Divisor) for a pair of numbers.
“Extended” means that algorithm will return not only GCD, but two coefficients x and y such that the equality
gcd
Finds an GCD (Greatest Common Divisor) for a pair of numbers.
gcd_many
Finds the GCD (Greatest Common Divisor) for an array of elements.
lcm
Finds an LCM (Least Common Multiple) for a pair of numbers.
lcm_many
Finds the LCM (Least Common Multiple) for an array of elements.