<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.math.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.is-nan.php',
    1 => 'is_nan',
    2 => 'V&eacute;rifie si un nombre flottant est NAN',
  ),
  'up' => 
  array (
    0 => 'ref.math.php',
    1 => 'Fonctions Math',
  ),
  'prev' => 
  array (
    0 => 'function.is-infinite.php',
    1 => 'is_infinite',
  ),
  'next' => 
  array (
    0 => 'function.log.php',
    1 => 'log',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/math/functions/is-nan.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.is-nan" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">is_nan</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">is_nan</span> &mdash; <span class="dc-title">Vérifie si un nombre flottant est NAN</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.is-nan-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>is_nan</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.float.php" class="type float">float</a></span> <code class="parameter">$num</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Retourne si le <code class="parameter">num</code> donné est <strong><code><a href="math.constants.php#constant.nan">NAN</a></code></strong> (<q class="quote">Not A Number</q>).
  </p>
  <p class="para">
   <strong><code><a href="math.constants.php#constant.nan">NAN</a></code></strong> est retourné par les opérations mathématiques qui ne sont pas définies,
   par exemple lors du passage de paramètres en dehors du domaine d&#039;entrée de la fonction.
   La racine carrée (<span class="function"><a href="function.sqrt.php" class="function">sqrt()</a></span>) n&#039;est définie que pour les nombres positifs,
   le passage d&#039;un nombre négatif résultera en un <strong><code><a href="math.constants.php#constant.nan">NAN</a></code></strong>.
   D&#039;autres exemples d&#039;opérations renvoyant <strong><code><a href="math.constants.php#constant.nan">NAN</a></code></strong> sont la division de
   <strong><code><a href="math.constants.php#constant.inf">INF</a></code></strong> par <strong><code><a href="math.constants.php#constant.inf">INF</a></code></strong> et toute opération impliquant
   une valeur <strong><code><a href="math.constants.php#constant.nan">NAN</a></code></strong> existante.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Malgré son nom <q class="quote">Not A Number</q>, <strong><code><a href="math.constants.php#constant.nan">NAN</a></code></strong> est une valeur valide de type <a href="language.types.float.php" class="link">nombre décimal</a>.
   </p>
  </p></blockquote>
  <div class="caution"><strong class="caution">Attention</strong>
   <p class="para">
    <strong><code><a href="math.constants.php#constant.nan">NAN</a></code></strong> ne se compare pas égal à <strong><code><a href="math.constants.php#constant.nan">NAN</a></code></strong>.
    Pour vérifier si un nombre flottant est <strong><code><a href="math.constants.php#constant.nan">NAN</a></code></strong>,
    <span class="function"><strong>is_nan()</strong></span> doit être utilisé. La vérification de
    <code class="code">$float === NAN</code> ne fonctionnera pas.
   </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.is-nan-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">num</code></dt>
     <dd>
      <p class="para">
       Le <a href="language.types.float.php" class="link">nombre décimal</a> à vérifier
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.is-nan-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> si <code class="parameter">num</code> est <strong><code><a href="math.constants.php#constant.nan">NAN</a></code></strong>, sinon <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.is-nan-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>is_nan()</strong></span></strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$nan </span><span style="color: #007700">= </span><span style="color: #0000BB">sqrt</span><span style="color: #007700">(-</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$nan</span><span style="color: #007700">, </span><span style="color: #0000BB">is_nan</span><span style="color: #007700">(</span><span style="color: #0000BB">$nan</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>L&#039;exemple ci-dessus va afficher :</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">float(NAN)
bool(true)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.is-nan-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.is-finite.php" class="function" rel="rdfs-seeAlso">is_finite()</a> - V&eacute;rifie si un nombre flottant est fini</span></li>
    <li><span class="function"><a href="function.is-infinite.php" class="function" rel="rdfs-seeAlso">is_infinite()</a> - V&eacute;rifie si un nombre flottant est infini</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>