"""
Math functions.
"""

from __future__ import absolute_import
from __future__ import division

__author__ = 'Shyue Ping Ong'
__copyright__ = 'Copyright 2013, The Materials Virtual Lab'
__version__ = '0.1'
__maintainer__ = 'Shyue Ping Ong'
__email__ = 'ongsp@ucsd.edu'
__date__ = '8/6/14'

import fractions


def gcd(*numbers):
    """
    Returns the greatest common denominator for a sequence of numbers.

    Args:
        \*numbers: Sequence of numbers.
    """
    return reduce(fractions.gcd, numbers)


def lcm(*numbers):
    """
    Return lowest common multiple of a sequence of numbers.

    Args:
        \*numbers: Sequence of numbers.
    """
    def lcm(a, b):
        return (a * b) // gcd(a, b)

    return reduce(lcm, numbers, 1)
@@ -367,16 +367,12 @@
 on d
-enominat
+ivis
 or f
@@ -439,32 +439,96 @@
 ence of numbers.
+%0A%0A    Returns:%0A        (int) Greatest common divisor of numbers.
 %0A    %22%22%22%0A    ret
@@ -654,32 +654,32 @@
 ers.%0A%0A    Args:%0A
-
         %5C*number
@@ -693,32 +693,95 @@
 ence of numbers.
+%0A%0A    Returns:%0A        (int) Lowest common multiple of numbers.
 %0A    %22%22%22%0A    def

Improve doc.