math module — py-utilities 0.0.1 documentation

# math module

## math_utilities

`py_utilities.math.math_utilities.` `gcd`(a, b)

  Returns the greatest common divisor using Euclid’s algo

      >>> gcd(12, 24)
      12

      >>> gcd(48, 4)
      4

      >>> gcd(2, 4)
      2

      >>> gcd(36, 48)
      12

`py_utilities.math.math_utilities.` `gcd_seq`(seq)

  Returns the greatest common divisor of seq

      >>> gcd_seq([12, 24, 48])
      12

`py_utilities.math.math_utilities.` `lcm`(a, b)

  Returns lowest common multiple

      >>> lcm(4, 8)
      8