PHP is_nan()

Anonymous contributor's avatar
Anonymous contributor
Published May 15, 2023
Contribute to Docs

The is_nan() function checks whether the argument is not a number.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours

Syntax

$result = is_nan(n);

Returns 1 if n is not a number, else returns nothing.

Codebyte Example

The following codebyte example uses is_nan() on the values of 10 and sqrt(-1) to check if each one is ‘not a number’:

Code
Output
Loading...

All contributors

Contribute to Docs

Learn PHP on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours