is_nan

(PHP 4 >= 4.2.0, PHP 5, PHP 7)

is_nanFinds whether a value is not a number

Descrierea

is_nan ( float $num ) : bool

Checks whether num is 'not a number', like the result of acos(1.01).

Parametri

num

The value to check

Valorile întoarse

Returns true if num is 'not a number', else false.

Exemple

Example #1 is_nan() example

<?php
// Invalid calculation, will return a 
// NaN value
$nan acos(8);

var_dump($nanis_nan($nan));
?>

Exemplul de mai sus va afișa:

float(NAN)
bool(true)

A se vedea și