import math


def position_check(inlat, inlon):
    """
    Simple check to make sure that the latitude and longitude are within the bounds specified 
    by the ICOADS documentation. Latitude is between -90 and 90. Longitude is between -180 and 360
    
    :param inlat: latitude
    :param inlon: longitude
    :type inlat: float
    :type inlon: float
    :return: 1 if either latitude or longitude is invalid, 0 otherwise
    :return type: integer
    """
    # return 1 if lat or lon is invalid, 0 otherwise
    assert inlat is not None and not (math.isnan(inlat))
    assert inlon is not None and not (math.isnan(inlon))
    result = 0
    if inlat < -90 or inlat > 90:
        result = 1
    if inlon < -180 or inlon > 360:
        result = 1
    assert result == 1 or result == 0
    return result