Check if float x is infinite (positive or negative). This function has been overriden from math.isinf to work element-wise on iterables