def is_inf(builder, val):
    """
    Return a condition testing whether *val* is an infinite.
    """
    pos_inf = Constant(val.type, float("+inf"))
    neg_inf = Constant(val.type, float("-inf"))
    isposinf = builder.fcmp_ordered('==', val, pos_inf)
    isneginf = builder.fcmp_ordered('==', val, neg_inf)
    return builder.or_(isposinf, isneginf)

    Return a condition testing whether *val* is an infinite.
    
numba/cpython/old_mathimpl.py