def hard_limit(val, limits):
    """
    Check if a value is outside specified limits
    
    :param val: value to be tested
    :param limits: two membered list of lower and upper limit
    :type val: float
    :type limits: list of floats
    
    :return: 1 if the input is outside the limits, 0 otherwise
    :return type: integer 
    """
    assert limits[1] > limits[0], 'limits are not well specified'
    if val is None:
        return 1
    result = 1
    if limits[0] <= val <= limits[1]:
        result = 0
    return result