Documented NaN behaviour. Closes bug #60346.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@320310 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Justin Martin 2011-12-03 18:43:05 +00:00
parent 637431c7cf
commit 3f82f09927

View file

@ -88,6 +88,22 @@ EXPONENT_DNUM [+-]?(({LNUM} | {DNUM}) [eE][+-]? {LNUM})
</para>
</sect2>
<sect2 xml:id="language.types.float.nan">
<title>NaN</title>
<para>
Some numeric operations can result in a value represented by the constant
<constant>NAN</constant>. This result represents an undefined or
unrepresentable value in floating-point calculations. Any loose or strict
comparisons of this value against any other value, including itself, will
have a result of &false;.
</para>
<para>
Because <constant>NAN</constant> represents any number of different values,
<constant>NAN</constant> should not be compared to other values, including
itself, and instead should be checked for using <function>is_nan</function>.
</para>
</sect2>
</sect1>
<!-- Keep this comment at the end of the file