def gcd(a, b):
    """
    Calculate the gcd of two numbers.

    Parameters
    ----------
    a: int
        One of the numbers used for compute the gcd.
    b: int
        One of the number used for compute the gcd.

    Returns
    -------
    out: int
        The gcd of the two numbers passed as arguments.
    """
    while b != 0:
        # we have that gcd(a, b) = gcd(b, r) where a = b * q + r
        a, b = b, a % b
    return a