PYTHON is_infinite

is this article helpful?
Python replacement for PHP's is_infinite [ edit | history ]
import math
math.isinf(val) # Python 2.6+

PHP is_infinite

PHP original manual for is_infinite [ show | ]


(PHP 4 >= 4.2.0, PHP 5)

is_infiniteFinds whether a value is infinite


bool is_infinite ( float $val )

Returns TRUE if val is infinite (positive or negative), like the result of log(0) or any value too big to fit into a float on this platform.



The value to check

Return Values

TRUE if val is infinite, else FALSE.

See Also

  • is_finite() - Finds whether a value is a legal finite number
  • is_nan() - Finds whether a value is not a number