PHP is_nan() Function
Example
Check whether a value is 'not-a-number':
<?php
echo is_nan(200) . "<br>";
echo is_nan(acos(1.01));
?>
Try it Yourself »
Definition and Usage
The is_nan() function checks whether a value is 'not a number'.
This function returns true (1) if the specified value is 'not-a-number', otherwise it returns false/nothing.
Syntax
is_nan(value);
Parameter Values
Parameter | Description |
---|---|
value | Required. Specifies the value to check |
Technical Details
Return Value: | TRUE if value is 'not a number', FALSE otherwise |
---|---|
Return Type: | Boolean |
PHP Version: | 4.2+ |
❮ PHP Math Reference