<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-menu-disabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 skin-theme-clientpref-os vector-sticky-header-enabled skin-thumbsize-clientpref-standard" lang="fr" dir="ltr"><head>
    <meta charset="UTF-8">
    <title>Math.h</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/png" href="./_res_/favicon.png">
    <link rel="canonical" href="https://fr.wikipedia.org/wiki/Math.h"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
    <meta name="ResourceLoaderDynamicStyles" content="">
    
    <link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
    <link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
    <link rel="stylesheet" type="text/css" href="./_res_/footer.css">
    <link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
  </head>
  <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Math_h rootpage-Math_h skin-vector-2022 action-view">
    <div class="mw-page-container">
      <div class="mw-page-container-inner">
        <div class="mw-content-container">
          <main id="content" class="mw-body">
            <header class="mw-body-header vector-page-titlebar">
              <h1 id="firstHeading" class="firstHeading mw-first-heading">math.h</h1>
            </header>
            <a id="top"></a>
            <div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
              <div id="contentSub">
                <div id="mw-content-subtitle"></div>
              </div>
              <div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="fr" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="fr" dir="ltr"><p>
<b>math.h</b> est un groupe de fonctions de la <a href="Biblioth%C3%A8que_standard_du_C" title="Bibliothèque standard du C">bibliothèque standard du C</a> qui permet d'utiliser un ensemble de fonctions mathématiques de base<sup id="cite_ref-c99_1-0" class="reference"><a href="#cite_note-c99-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference cite_virgule">,</sup><sup id="cite_ref-c_primer:1_2-0" class="reference"><a href="#cite_note-c_primer:1-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>, utilisant des&nbsp;<a href="Virgule_flottante" title="Virgule flottante">nombres à virgule flottante</a>. Les différents standards du C les implémentent différemment, mais en restant toujours rétrocompatibles. La plupart de ces fonctions sont également disponibles dans la&nbsp;<a href="Biblioth%C3%A8que_standard_de_C%2B%2B" class="mw-redirect" title="Bibliothèque standard de C++">bibliothèque standard de C++</a>, bien que dans un autre en-tête (les en-têtes du C sont inclus, mais uniquement pour assurer la compatibilité).
</p>

<div class="mw-heading mw-heading2"><h2 id="Aperçu_des_fonctions"><span id="Aper.C3.A7u_des_fonctions"></span>Aperçu des fonctions</h2></div>
<p>La plupart des fonctions sont contenues dans l'en-tête <tt>math.h</tt> (ou dans l'en-tête <tt>cmath</tt> en C++). Les fonctions qui opèrent sur les entiers, telles que <tt>abs</tt>, <tt>labs</tt>, <tt>div</tt>, ou <tt>ldiv</tt> sont par contre spécifiées dans <tt>stdlib.h</tt> (<tt>cstdlib</tt> en C++).
</p><p>Toutes les fonctions qui font intervenir des angles utilisent le radian comme unité<sup id="cite_ref-c99_1-1" class="reference"><a href="#cite_note-c99-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>.
</p><p>Toutes les fonctions ne sont pas présentes dans la version C89 du standard du C. Pour celles qui le sont, les fonctions n'acceptent que le type <tt>double</tt> pour les opérations sur des nombres à virgule flottante. Dans la norme C99, cette limitation a été levée en introduisant une nouvelle série de fonctions fonctionnant avec des paramètres de type&nbsp;<tt>float</tt> ou <tt>long double</tt>. Ces fonctions sont identifiables respectivement par le suffixe <tt>f</tt> ou <tt>l</tt><sup id="cite_ref-c_primer_c99:2_3-0" class="reference"><a href="#cite_note-c_primer_c99:2-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>.
</p>
<table class="wikitable" style="font-size:0.85em">
<tbody><tr>
<th>
</th>
<th>Fonction
</th>
<th>Description
</th></tr>
<tr>
<th rowspan="11">
</th>
<td><span id="abs"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/abs">abs</a></code><br><span id="labs"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/labs">labs</a></code><br><span id="llabs"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/llabs">llabs</a></code>
</td>
<td>calcule la <a href="Valeur_absolue" title="Valeur absolue">valeur absolue</a> d'un nombre entier
</td></tr>
<tr>
<td><span id="fabs"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/fabs">fabs</a></code>
</td>
<td>calcule la valeur absolue d'un nombre de type float
</td></tr>
<tr>
<td><span id="div"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/div">div</a></code><br><span id="ldiv"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/ldiv">ldiv</a></code><br><span id="lldiv"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/lldiv">lldiv</a></code>
</td>
<td>calcule le quotient et le reste de la division euclidienne<br>
</td></tr>
<tr>
<td><span id="fmod"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/fmod">fmod</a></code>
</td>
<td>reste de la division de nombres à virgule flottante<br>
</td></tr>
<tr>
<td><span id="remainder"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/remainder">remainder</a></code>
</td>
<td>reste signé de l'opération de division
</td></tr>
<tr>
<td><span id="remquo"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/remquo">remquo</a></code>
</td>
<td>reste signé ainsi que les trois derniers bits de l'opération de division
</td></tr>
<tr>
<td><span id="fma"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/fma">fma</a></code>
</td>
<td>Multiplication puis addition (Multiply-accumulate)
</td></tr>
<tr>
<td><span id="fmax"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/fmax">fmax</a></code>
</td>
<td>maximum des deux valeurs à virgule flottante
</td></tr>
<tr>
<td><span id="fmin"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/fmin">fmin</a></code>
</td>
<td>minimum des deux valeurs à virgule flottante
</td></tr>
<tr>
<td><span id="fdim"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/fdim">fdim</a></code>
</td>
<td>différence positive de deux valeurs à virgule flottante
</td></tr>
<tr>
<td><span id="nan"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/nan">nan</a></code><br><span id="nanf"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/nanf">nanf</a></code><br><span id="nanl"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/nanl">nanl</a></code>
</td>
<td>Retourne un <a href="NaN" title="NaN">not-a-number</a> (NaN)
</td></tr>
<tr>
<th rowspan="9">Fonctions exponentielles
</th>
<td><span id="exp"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/exp">exp</a></code>
</td>
<td>retourne <a href="E_(nombre)" title="E (nombre)">e</a> élevé à la puissance demandée<br>
</td></tr>
<tr>
<td><span id="exp2"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/exp2">exp2</a></code>
</td>
<td>retourne 2 élevé à la puissance demandée<br>
</td></tr>
<tr>
<td><span id="expm1"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/expm1">expm1</a></code>
</td>
<td>retourne e élevé à la puissance demandée moins 1<br>
</td></tr>
<tr>
<td><span id="log"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/log">log</a></code>
</td>
<td>calcule le <a href="Logarithme_naturel" class="mw-redirect" title="Logarithme naturel">logarithme naturel</a> (en base e)
</td></tr>
<tr>
<td><span id="log2"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/log2">log2</a></code>
</td>
<td>calcule le logarithme binaire (en base 2)
</td></tr>
<tr>
<td><span id="log10"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/log10">log10</a></code>
</td>
<td>calcule le <a href="Logarithme_d%C3%A9cimal" title="Logarithme décimal">logarithme décimal</a> (en base 10)
</td></tr>
<tr>
<td><span id="log1p"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/log1p">log1p</a></code>
</td>
<td>calcule le logarithme naturel (en base e) de 1 plus le nombre donné<br>
</td></tr>
<tr>
<td><span id="ilogb"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/ilogb">ilogb</a></code>
</td>
<td>extrait l'exposant d'un nombre
</td></tr>
<tr>
<td><span id="logb"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/logb">logb</a></code>
</td>
<td>extrait l'exposant d'un nombre
</td></tr>
<tr>
<th rowspan="4">Fonctions puissance
</th>
<td><span id="sqrt"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/sqrt">sqrt</a></code>
</td>
<td>calcule la <a href="Racine_carr%C3%A9e" title="Racine carrée">racine carrée</a>
</td></tr>
<tr>
<td><span id="cbrt"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/cbrt">cbrt</a></code>
</td>
<td>calcule la racine cubique
</td></tr>
<tr>
<td><span id="hypot"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/hypot">hypot</a></code>
</td>
<td>calcule la racine carrée de la somme des carrés des deux nombres donnés
</td></tr>
<tr>
<td><span id="pow"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/pow">pow</a></code>
</td>
<td>élève un nombre à la puissance donnée<br>
</td></tr>
<tr>
<th rowspan="7">Fonctions trigonométriques
</th>
<td><span id="sin"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/sin">sin</a></code>
</td>
<td>calcule le sinus
</td></tr>
<tr>
<td><span id="cos"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/cos">cos</a></code>
</td>
<td>calcule le <a href="Fonction_trigonom%C3%A9trique" title="Fonction trigonométrique">cosinus</a>
</td></tr>
<tr>
<td><span id="tan"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/tan">tan</a></code>
</td>
<td>calcule la <a href="Tangente_(g%C3%A9om%C3%A9trie)" title="Tangente (géométrie)">tangente</a>
</td></tr>
<tr>
<td><span id="asin"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/asin">asin</a></code>
</td>
<td>calcule l'arc sinus
</td></tr>
<tr>
<td><span id="acos"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/acos">acos</a></code>
</td>
<td>calcule l'arc cosinus
</td></tr>
<tr>
<td><span id="atan"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/atan">atan</a></code>
</td>
<td>calcule l'arc tangente
</td></tr>
<tr>
<td><span id="atan2"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/atan2">atan2</a></code>
</td>
<td>calcule l'arc tangente, en utilisant le signe pour déterminer le quadrant<br>
</td></tr>
<tr>
<th rowspan="6">Fonctions hyperboliques
</th>
<td><span id="sinh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/sinh">sinh</a></code>
</td>
<td>calcule le sinus hyperbolique<br>
</td></tr>
<tr>
<td><span id="cosh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/cosh">cosh</a></code>
</td>
<td>calcule le cosinus hyperbolique
</td></tr>
<tr>
<td><span id="tanh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/tanh">tanh</a></code>
</td>
<td>calcule la tangente hyperbolique
</td></tr>
<tr>
<td><span id="asinh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/asinh">asinh</a></code>
</td>
<td>calcule l'arc sinus hyperbolique
</td></tr>
<tr>
<td><span id="acosh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/acosh">acosh</a></code>
</td>
<td>calcule l'arc cosinus hyperbolique
</td></tr>
<tr>
<td><span id="atanh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/atanh">atanh</a></code>
</td>
<td>calcule l'arc tangente hyperbolique
</td></tr>
<tr>
<th rowspan="4">Fonction d'erreur et fonction gamma
</th>
<td><span id="erf"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/erf">erf</a></code>
</td>
<td>calcule la fonction d'erreur
</td></tr>
<tr>
<td><span id="erfc"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/erfc">erfc</a></code>
</td>
<td>calcule la <a href="Fonction_d'erreur" title="Fonction d'erreur">fonction d'erreur complémentaire</a>
</td></tr>
<tr>
<td><span id="lgamma"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/lgamma">lgamma</a></code>
</td>
<td>calcule le logarithme naturel de la valeur absolue de la <a href="Fonction_gamma" title="Fonction gamma">fonction gamma</a>
</td></tr>
<tr>
<td><span id="tgamma"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/tgamma">tgamma</a></code>
</td>
<td>calcule la fonction gamma
</td></tr>
<tr>
<th rowspan="6">Opérations d'arrondi
</th>
<td><span id="ceil"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/ceil">ceil</a></code>
</td>
<td>renvoie le nombre entier supérieur le plus proche
</td></tr>
<tr>
<td><span id="floor"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/floor">floor</a></code>
</td>
<td>renvoie le nombre entier inférieur le plus proche
</td></tr>
<tr>
<td><span id="trunc"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/trunc">trunc</a></code>
</td>
<td>retourne l'entier le plus proche dont la valeur absolue est inférieure
</td></tr>
<tr>
<td><span id="round"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/round">round</a></code><br><span id="lround"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/lround">lround</a></code><br><span id="llround"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/llround">llround</a></code>
</td>
<td>retourne l'entier le plus proche, suivant les règles d'arrondi
</td></tr>
<tr>
<td><span id="nearbyint"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/nearbyint">nearbyint</a></code>
</td>
<td>retourne l'entier le plus proche en utilisant la méthode d'arrondi courante
</td></tr>
<tr>
<td><span id="rint"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/rint">rint</a></code><br><span id="lrint"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/lrint">lrint</a></code><br><span id="llrint"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/llrint">llrint</a></code>
</td>
<td>retourne l'entier le plus proche en utilisant la méthode d'arrondi courante avec exception si le résultat diffère
</td></tr>
<tr>
<th rowspan="6">Fonctions de manipulation de nombres à virgule flottante
</th>
<td><span id="frexp"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/frexp">frexp</a></code>
</td>
<td>décompose le paramètre en un nombre et une puissance de 2
</td></tr>
<tr>
<td><span id="ldexp"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/ldexp">ldexp</a></code>
</td>
<td>multiplie un nombre par un nombre élevé à une puissance de 2
</td></tr>
<tr>
<td><span id="modf"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/modf">modf</a></code>
</td>
<td>décompose un nombre en un entier et sa partie fractionnelle.
</td></tr>
<tr>
<td><span id="scalbn"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/scalbn">scalbn</a></code><br><span id="scalbln"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/scalbln">scalbln</a></code>
</td>
<td>multiplie un nombre par FLT_RADIX élevé à une puissance donnée
</td></tr>
<tr>
<td><span id="nextafter"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/nextafter">nextafter</a></code><br><span id="nexttoward"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/nexttoward">nexttoward</a></code>
</td>
<td>retourne la prochaine valeur représentable en virgule flottante
</td></tr>
<tr>
<td><span id="copysign"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/copysign">copysign</a></code>
</td>
<td>copie le signe d'un nombre à virgule flottante
</td></tr>
<tr>
<th rowspan="6">Classification
</th>
<td><span id="fpclassify"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/fpclassify">fpclassify</a></code>
</td>
<td>catégorise une valeur en virgule flottante
</td></tr>
<tr>
<td><span id="isfinite"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/isfinite">isfinite</a></code>
</td>
<td>vérifie si le nombre donné a une valeur finie
</td></tr>
<tr>
<td><span id="isinf"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/isinf">isinf</a></code>
</td>
<td>vérifie si le nombre donné a une valeur infinie
</td></tr>
<tr>
<td><span id="isnan"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/isnan">isnan</a></code>
</td>
<td>vérifie si le nombre donné est NaN
</td></tr>
<tr>
<td><span id="isnormal"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/isnormal">isnormal</a></code>
</td>
<td>vérifie si le nombre donné est normal
</td></tr>
<tr>
<td><span id="signbit"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math/signbit">signbit</a></code>
</td>
<td>vérifie si le nombre donné est négatif
</td></tr></tbody></table>
<div class="mw-heading mw-heading3"><h3 id="Environnement_en_virgule_flottante"><span id="fenv.h"></span>Environnement en virgule flottante</h3></div>
<p>C99 ajoute plusieurs fonctions et types pour contrôler plus finement l’environnement en virgule flottante<sup id="cite_ref-c_primer_c99:3_4-0" class="reference"><a href="#cite_note-c_primer_c99:3-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>. Ces fonctions peuvent être utilisées pour contrôler un certain nombre de paramètres qui affectent le calcul avec des nombres à virgule flottante, par exemple le mode d'arrondi, quand les nombres doivent être remis à zéro, etc. Ces fonctions sont définies dans l'en-tête <tt>fenv.h</tt> (<tt>cfenv</tt> en <a href="C%2B%2B" title="C++">C++</a>).
</p>
<table class="wikitable" style="font-size: 0.85em; margin-bottom: 10px;">
<tbody><tr>
<th>Fonction
</th>
<th>Description
</th></tr>
<tr>
<td><span id="feclearexcept"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/fenv/feclearexcept">feclearexcept</a></code>
</td>
<td>retire les exceptions (C99)
</td></tr>
<tr>
<td><span id="fegetenv"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/fenv/feenv">fegetenv</a></code>
</td>
<td>enregistre l'environnement actuel (C99)
</td></tr>
<tr>
<td><span id="fegetexceptflag"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/fenv/feexceptflag">fegetexceptflag</a></code>
</td>
<td>enregistre les flags de statut (C99)
</td></tr>
<tr>
<td><span id="fegetround"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/fenv/feround">fegetround</a></code>
</td>
<td>récupère la direction actuelle de l'arrondi (C99)
</td></tr>
<tr>
<td><span id="feholdexcept"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/fenv/feholdexcept">feholdexcept</a></code>
</td>
<td>enregistre l'environnement actuel et nettoie les exceptions (C99)
</td></tr>
<tr>
<td><span id="feraiseexcept"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/fenv/feraiseexcept">feraiseexcept</a></code>
</td>
<td>soulève une exception (C99)
</td></tr>
<tr>
<td><span id="fesetenv"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/fenv/feenv">fesetenv</a></code>
</td>
<td>met en place un environnement (C99)
</td></tr>
<tr>
<td><span id="fesetexceptflag"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/fenv/feexceptflag">fesetexceptflag</a></code>
</td>
<td>met en place un flag de statut (C99)
</td></tr>
<tr>
<td><span id="fesetround"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/fenv/feround">fesetround</a></code>
</td>
<td>choisi la direction de l'arrondi (C99)
</td></tr>
<tr>
<td><span id="fetestexcept"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/fenv/fetestexcept">fetestexcept</a></code>
</td>
<td>test si certaines exceptions ont été soulevées (C99)
</td></tr>
<tr>
<td><span id="feupdateenv"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/fenv/feupdateenv">feupdateenv</a></code>
</td>
<td>restaure un environnement en conservant les exceptions soulevées&nbsp; (C99)
</td></tr></tbody></table>
<div class="mw-heading mw-heading3"><h3 id="Nombres_complexes"><span id="complex.h"></span> Nombres complexes</h3></div>
<p>C99 ajoute le nouveau mot-clé <tt>_Complex</tt> (et la macro <tt>complex</tt> pour plus de commodité) qui permet de gérer des nombres complexes. Ceux-ci se présentent sous la forme de deux nombres à virgule flottante.
</p><p>C++ ne propose pas de rétro-compatibilité concernant les nombres complexes, mais fournit la classe <tt>std::complex</tt>.
</p><p>Toutes les opérations sur des nombres complexes sont définies dans l'en-tête <tt>complex.h</tt>. Comme pour les fonctions sur les entiers, les suffixes <tt>f</tt> et <tt>l</tt> sont les variantes de la fonction utilisant respectivement les types <tt>float complex</tt> et <tt>long double complex</tt>.
</p>
<table class="wikitable" style="font-size: 0.85em; margin-bottom: 10px;">

<tbody><tr>
<th>Fonction
</th>
<th>Description
</th></tr>
<tr>
<th rowspan="6">Opérations de base
</th>
<td><span id="cabs"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/cabs">cabs</a></code>
</td>
<td>calcule la valeur absolue (C99)
</td></tr>
<tr>
<td><span id="carg"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/carg">carg</a></code>
</td>
<td>calcule l'argument(C99)
</td></tr>
<tr>
<td><span id="cimag"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/cimag">cimag</a></code>
</td>
<td>renvoie la partie imaginaire d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="creal"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/creal">creal</a></code>
</td>
<td>renvoie la <a href="Nombre_complexe" title="Nombre complexe">partie réelle</a> d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="conj"></span><code><a rel="nofollow" class="external text" href="http://www.opengroup.org/onlinepubs/9699919799/functions/conj.html">conj</a></code>
</td>
<td>renvoie le&nbsp; <a href="Conjugu%C3%A9" title="Conjugué">conjugué</a> d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="cproj"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/cproj">cproj</a></code>
</td>
<td>calcule la projection du nombre complexe sur la sphère de Riemann (C99)
</td></tr>
<tr>
<th rowspan="4">Opérations exponentielles
</th>
<td><span id="cexp"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/cexp">cexp</a></code>
</td>
<td>calcule l'exponentiel d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="clog"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/clog">clog</a></code>
</td>
<td>calcule le <a href="Logarithme" title="Logarithme">logarithme</a> d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="csqrt"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/csqrt">csqrt</a></code>
</td>
<td>calcule la <a href="Racine_carr%C3%A9e" title="Racine carrée">racine carrée</a> d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="cpow"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/cpow">cpow</a></code>
</td>
<td>calcule la <a href="Exponentiation" title="Exponentiation">puissance</a> d'un nombre complexe (C99)
</td></tr>
<tr>
<th rowspan="6">Opérations trigonométriques
</th>
<td><span id="csin"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/csin">csin</a></code>
</td>
<td>calcule le sinus d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="ccos"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/ccos">ccos</a></code>
</td>
<td>calcule le cosinus d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="ctan"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/ctan">ctan</a></code>
</td>
<td>calcule la tangente d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="casin"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/casin">casin</a></code>
</td>
<td>calcule l'arc sinus d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="cacos"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/cacos">cacos</a></code>
</td>
<td>calcule l'arc cosinus d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="catan"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/catan">catan</a></code>
</td>
<td>calcule l'<a href="Arc_sinus" title="Arc sinus">arc tangente</a> d'un nombre complexe (C99)
</td></tr>
<tr>
<th rowspan="6">Opérations hyperboliques
</th>
<td><span id="csinh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/csinh">csinh</a></code>
</td>
<td>calcule le sinus hyperbolique d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="ccosh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/ccosh">ccosh</a></code>
</td>
<td>calcule le cosinus hyperbolique d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="ctanh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/ctanh">ctanh</a></code>
</td>
<td>calcule la <a href="Fonction_hyperbolique" title="Fonction hyperbolique">tangente hyperbolique</a> d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="casinh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/casinh">casinh</a></code>
</td>
<td>calcule l'arc sinus hyperbolique d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="cacosh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/cacosh">cacosh</a></code>
</td>
<td>calcule l'arc cosinus hyperbolique d'un nombre complexe (C99)
</td></tr>
<tr>
<td><span id="catanh"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/complex/catanh">catanh</a></code>
</td>
<td>calcule l'arc tangente hyperbolique d'un nombre complexe (C99)
</td></tr></tbody></table>
<div class="mw-heading mw-heading3"><h3 id="Génération_de_nombres_aléatoires"><span id="G.C3.A9n.C3.A9ration_de_nombres_al.C3.A9atoires"></span>Génération de nombres aléatoires</h3></div>
<p><span id="stdlib.h"></span> L'en-tête <tt>stdlib.h</tt> (<tt>cstdlib</tt> en C++) définit plusieurs fonctions qui peuvent être utilisées pour de la génération statique de nombres aléatoires<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>.
</p>
<table class="wikitable" style="font-size: 0.85em; margin-bottom: 10px;">
<tbody><tr>
<th>Fonction
</th>
<th>Description
</th></tr>
<tr>
<td><span id="rand"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/random/rand">rand</a></code>
</td>
<td>génère un nombre pseudo-aléatoire<br>
</td></tr>
<tr>
<td><span id="srand"></span><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/random/srand">srand</a></code>
</td>
<td>initialise un <a href="G%C3%A9n%C3%A9rateur_de_nombres_pseudo-al%C3%A9atoires" title="Générateur de nombres pseudo-aléatoires">générateur de nombres pseudo-aléatoires</a>
</td></tr></tbody></table>
<div class="mw-heading mw-heading2"><h2 id="libm">libm</h2></div>
<p>Sous <a href="Linux" title="Linux">Linux</a> et <a href="FreeBSD" title="FreeBSD">FreeBSD</a>, les fonctions mathématiques (telles que déclarées dans <tt>math.h</tt>)&nbsp;sont regroupées séparément dans la bibliothèque mathématique <tt>libm</tt>. Donc si l'une de ces fonctions est utilisée, la directive <tt>-lm</tt> doit être ajoutée à l'éditeur de liens.
</p>
<div class="mw-heading mw-heading2"><h2 id="Notes_et_références"><span id="Notes_et_r.C3.A9f.C3.A9rences"></span>Notes et références</h2></div>
<div class="references-small decimal" style=""><div class="mw-references-wrap"><ol class="references">
<li id="cite_note-c99-1"><span class="reference-text"><span class="ouvrage"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> <cite class="italique" lang="en">ISO/IEC 9899&nbsp;: 1999 specification</cite> <small style="line-height:1em;">(<a rel="nofollow" class="external text" href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf">lire en ligne</a>)</small>, p. 212, § 7.12<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=ISO%2FIEC+9899&amp;rft.stitle=1999+specification&amp;rft.pages=p.+212%2C+%C2%A7+7.12&amp;rfr_id=info%3Asid%2Ffr.wikipedia.org%3AMath.h"></span></span>.</span>
</li>
<li id="cite_note-c_primer:1-2"><span class="mw-cite-backlink"><a href="#cite_ref-c_primer:1_2-0">↑</a> </span><span class="reference-text"><span class="ouvrage" id="Prata2004"><span class="ouvrage" id="Stephen_Prata2004"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> Stephen <span class="nom_auteur">Prata</span>, <cite class="italique" lang="en">C primer plus&nbsp;: Includes Index</cite>, Sams Publishing, <time>2004</time>, 959&nbsp;<abbr class="abbr" title="pages">p.</abbr> <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a>&nbsp;<span class="nowrap">0-672-32696-5</span>)</small>, Appendix B, Section V: The Standard ANSI C Library with C99 Additions<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=C+primer+plus&amp;rft.pub=Sams+Publishing&amp;rft.stitle=Includes+Index&amp;rft.aulast=Prata&amp;rft.aufirst=Stephen&amp;rft.date=2004&amp;rft.pages=Appendix+B%2C+Section+V%3A+The+Standard+ANSI+C+Library+with+C99+Additions&amp;rft.tpages=959&amp;rft.isbn=0-672-32696-5&amp;rfr_id=info%3Asid%2Ffr.wikipedia.org%3AMath.h"></span></span></span>.</span>
</li>
<li id="cite_note-c_primer_c99:2-3"><span class="mw-cite-backlink"><a href="#cite_ref-c_primer_c99:2_3-0">↑</a> </span><span class="reference-text"><span class="ouvrage" id="Prata2004"><span class="ouvrage" id="Stephen_Prata2004">Stephen <span class="nom_auteur">Prata</span>, <cite class="italique">C primer plus&nbsp;: Includes Index</cite>, Sams Publishing, <time>2004</time>, 959&nbsp;<abbr class="abbr" title="pages">p.</abbr> <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a>&nbsp;<span class="nowrap">0-672-32696-5</span>)</small>, Appendix B, Section VIII: C99 Numeric Computational Enhancements<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=C+primer+plus&amp;rft.pub=Sams+Publishing&amp;rft.stitle=Includes+Index&amp;rft.aulast=Prata&amp;rft.aufirst=Stephen&amp;rft.date=2004&amp;rft.pages=Appendix+B%2C+Section+VIII%3A+C99+Numeric+Computational+Enhancements&amp;rft.tpages=959&amp;rft.isbn=0-672-32696-5&amp;rfr_id=info%3Asid%2Ffr.wikipedia.org%3AMath.h"></span></span></span>.</span>
</li>
<li id="cite_note-c_primer_c99:3-4"><span class="mw-cite-backlink"><a href="#cite_ref-c_primer_c99:3_4-0">↑</a> </span><span class="reference-text"><span class="ouvrage" id="Prata2004"><span class="ouvrage" id="Stephen_Prata2004"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> Stephen <span class="nom_auteur">Prata</span>, <cite class="italique" lang="en">C primer plus&nbsp;: Includes Index</cite>, Sams Publishing, <time>2004</time>, 959&nbsp;<abbr class="abbr" title="pages">p.</abbr> <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a>&nbsp;<span class="nowrap">0-672-32696-5</span>)</small>, Appendix B, Section VIII: C99 Numeric Computational Enhancements<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=C+primer+plus&amp;rft.pub=Sams+Publishing&amp;rft.stitle=Includes+Index&amp;rft.aulast=Prata&amp;rft.aufirst=Stephen&amp;rft.date=2004&amp;rft.pages=Appendix+B%2C+Section+VIII%3A+C99+Numeric+Computational+Enhancements&amp;rft.tpages=959&amp;rft.isbn=0-672-32696-5&amp;rfr_id=info%3Asid%2Ffr.wikipedia.org%3AMath.h"></span></span></span>.</span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><a href="#cite_ref-5">↑</a> </span><span class="reference-text"><span class="ouvrage">«&nbsp;<a rel="nofollow" class="external text" href="https://www.gnu.org/software/libc/manual/html_node/ISO-Random.html"><cite style="font-style:normal;">The GNU C Library – ISO Random</cite></a>&nbsp;» <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2018-07-18" data-sort-value="2018-07-18">18 juillet 2018</time>)</small></span>.</span>
</li>
</ol></div>
</div>
<ul><li><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> Cet article est partiellement ou en totalité issu de l’article de Wikipédia en anglais intitulé <span class="">«&nbsp;<a class="external text" href="https://en.wikipedia.org/wiki/C_mathematical_functions?oldid=650825461">C mathematical functions</a>&nbsp;» <small>(<a class="external text" href="https://en.wikipedia.org/wiki/C_mathematical_functions?action=history">voir la liste des auteurs</a>)</small></span>.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Liens_externes">Liens externes</h2></div>
<ul><li><tt><a rel="nofollow" class="external text" href="http://www.opengroup.org/onlinepubs/9699919799/basedefs/math.h.html">math.h</a></tt>&nbsp;: <i><span class="lang-en" lang="en">mathematical declarations – Base Definitions Reference</span></i>, <a href="Single_UNIX_Specification" title="Single UNIX Specification">The Single UNIX® Specification</a>, Issue 7 from <a href="Open_Group" title="Open Group">The Open Group</a></li>
<li><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/c/numeric/math">C reference for math functions</a></li></ul>
<ul id="bandeau-portail" class="bandeau-portail"><li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"><img alt="icône décorative" src="./_assets_/0c70a452f799bfe840676ee341124611/Circle-icons-dev.svg.png" decoding="async" width="24" height="24" class="mw-file-element" data-file-width="512" data-file-height="512" loading="lazy"></span></span> <span class="bandeau-portail-texte">Portail de la programmation informatique</span> </span></li>                    </ul></div><!--htdig_noindex--><div><div class="zim-footer">
    Cet article est issu de <a class="external text" title="Dernière modification le 2024-10-01" href="https://fr.wikipedia.org/wiki/?title=Math.h&amp;oldid=219085932">Wikipédia</a>. Sauf mention contraire, le texte est disponible sous <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.fr">Creative Commons Attribution-Share Alike 4.0</a>. Des conditions supplémentaires peuvent s’appliquer aux fichiers multimédias.
</div>
</div><!--/htdig_noindex--></div>
            </div>
          </main>
        </div>
      </div>
    </div>
     <script src="./_webp_/webpHandler.js"></script>
  

</body></html>