def METHOD_NAME(value, dtype):
    """
    Check if the value is within the dtype range
    """
    if np.dtype(dtype).kind == "f" and (math.isinf(value) or math.isnan(value)):
        return True
    range_min, range_max = dtype_ranges[dtype]
    return range_min <= value <= range_max