def _nearclamp(value, floor, ceil, epsilon=1e-13):
    """
    Returns a clamped value if it is within espilson of the range. [INTERNAL FUNCTION]
    
    If value is more than epsilon less than floor or epsilon greater than ceil, nothing
    happens.  Otherwise, the value is clamped to within [floor,ceil]
    
    :return: a clamped value if it is within espilson of the range
    :rtype:  ``int`` or ``float``
    
    :param value: The value to clamp
    :type value:  ``int`` or ``float``
    
    :param floor: The minimum of the range (or None if -infinity)
    :type floor:  ``int``, ``float``, or ``None``
    
    :param ceil: The maximum of the range (or None if infinity)
    :type ceil:  ``int``, ``float``, or ``None``
    
    :param epsilon: The margin of error
    :type epsilon:  ``int`` or ``float``
    """
    if not ceil is None and value > ceil:
        value = min(value, ceil) if value < ceil + epsilon else value
    if not floor is None and value < floor:
        value = max(value, floor) if value > floor - epsilon else value
    return value
