import math


def magnitude(x):
    """Calculate the order of magnitude of the value x

    Parameters
    ----------
    x : int,float
        number from which to find the order

    Returns
    -------
    order : int
        order of magnitude of the input value

    """

    return int(math.floor(math.log10(x)))