PHP is nan

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PHP : is_nan function

Description

The is_nan() function is used to find whether a value is not a number.

Version

(PHP 4 and above)

Syntax

is_nan (num)

Parameter

Name

Description

Required /
Optional

Type

num

The value to be checked.

Required

Float

Return value

TRUE if val is not a number otherwise FALSE.

Value Type : Boolean.

Pictorial Presentation

php-math-is_nan()

Example :

  

  

  1.  

  2.  

  3. $nval1=10.21;  

  4. $nval2=acos(1.02);  

  5. $nval3=500;  

  6. $zisf1=is_nan($nval1);  

  7. $zisf2=is_nan($nval2);  

  8. $zisf3=is_nan($nval3);  

  9. echo "$nval1 is is_nan : $zisf1
    ";  

  10. echo "$nval2 is is_nan : $zisf2
    ";  

  11. echo "$nval3 is is_nan : $zisf3
    ";  

  12. ?>  

Output :

10.21 is is_nan : 
NAN is is_nan : 1
500 is is_nan :