def mul_constant(I1, n):
    """Calculate the multiplication of an interval by a constant

    Keyword arguments:
    I1 -- the interval given as a tuple (a, b)
    n -- the real constant to multiply with
    """
    (from1, to1) = I1
    return (min(from1 * n, to1 * n), max(from1 * n, to1 * n))