THE WORLD'S LARGEST WEB DEVELOPER SITE

PHP is_nan() Function

❮ PHP Math Reference

Example

Check whether a value is 'not-a-number':

<?php
echo is_nan(200) . "<br>";
echo is_nan(acos(1.01));
?>
Run example »

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 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