def __truncate(x, precision):
    """
    Truncates a float

    INPUT:

    - ``x`` -- value to be truncated
    - ``precision`` -- number of decimal places to after which the ``x`` is truncated

    """

    return float(int(x * 10 ** precision) / 10 ** precision)