PHP is_infinite() Function
In this chapter you will learn:
- Definition for PHP is_infinite() Function
- Syntax for PHP is_infinite() Function
- Parameter for PHP is_infinite() Function
- Return for PHP is_infinite() Function
- Example - Check whether a value is infinite or not
Definition
The is_infinite() function checks whether a value is infinite or not.
Syntax
PHP is_infinite() Function has the following syntax.
is_infinite(value);
Parameter
Parameter | Is Required | Description |
---|---|---|
value | Required. | Value to check |
Return
Item | Description |
---|---|
Return Value | TRUE if value is an infinite number, FALSE otherwise |
Return Type | Boolean |
This function returns true (1) if the specified value is an infinite number which is outside the allowed range for a PHP float on this platform, otherwise it returns false/nothing.
Example
Check whether a value is infinite or not:
<?php/*from j a va2s .c o m*/
echo is_infinite(2) . "\n";
echo is_infinite(log(0)) . "\n";
echo is_infinite(2000);
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP is_nan() Function
- Syntax for PHP is_nan() Function
- Parameter for PHP is_nan() Function
- Return for PHP is_nan() Function
- Example - Check whether a value is 'not-a-number'
Home » PHP Tutorial » PHP Math Functions