math.isinf()

math.isinf(x) → bool

Check if float x is infinite (positive or negative).