HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

is_nan

Description

The is_nan of Math for PHP checks whether a float is NAN (not a number).

Syntax

is_nan(
    float $num
): bool

Parameters

num

The float to check

Return

true if num is NAN, else false.

Examples

1 · num · 0

<?

$num = 0;

$return = is_nan($num);

var_export($return);
false

2 · num · -INF

<?

$num = -INF;

$return = is_nan($num);

var_export($return);
false

3 · num · INF

<?

$num = INF;

$return = is_nan($num);

var_export($return);
false

4 · num · NAN

<?

$num = NAN;

$return = is_nan($num);

var_export($return);
true