HH\Lib\Math\is_nan

Requires the Hack Standard Library to be installed.

Returns whether a num is NAN

namespace HH\Lib\Math;

function is_nan(
  num $num,
): bool;

NAN is "the not-a-number special float value"

When comparing NAN to any value (including NAN) using operators false will be returned. NAN === NAN is false.

One must always check for NAN using is_nan and not $x === NAN.

Parameters

  • num $num

Returns

  • bool