def unit_limit(x):
    """ Forces value to be in [-1, 1]

    Parameters
    ----------
    x: float, int
        The value to adjust.

    Retruns
    -------
    float
        The adjusted value.
    """
    return min(max(-1.0, x), 1.0)
