1.2.663. Manipulates NaN

This code handles Not-a-Number situations. Not-a-Number, also called NaN, happens when a calculation can’t return an actual float.

<?php

// acos returns a float, unless it is not possible.
$a = acos(8);

var_dump(is_nan($a));

?>

See also Floats.

1.2.663.1. Suggestions

  • Add the third argument, and set it to true

1.2.663.2. Specs

Short name

Php/IsNAN

Rulesets

All, Appinfo, CE, Changed Behavior

Exakat since

0.10.6

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Features

float

Available in

Entreprise Edition, Community Edition, Exakat Cloud