<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/mongodb.bson.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'class.mongodb-bson-decimal128.php',
    1 => 'MongoDB\\BSON\\Decimal128',
    2 => 'La classe MongoDB\\BSON\\Decimal128',
  ),
  'up' => 
  array (
    0 => 'mongodb.bson.php',
    1 => 'MongoDB\\BSON',
  ),
  'prev' => 
  array (
    0 => 'enum.mongodb-bson-vectortype.php',
    1 => 'MongoDB\\BSON\\VectorType',
  ),
  'next' => 
  array (
    0 => 'mongodb-bson-decimal128.construct.php',
    1 => 'MongoDB\\BSON\\Decimal128::__construct',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/mongodb/bson/decimal128.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.mongodb-bson-decimal128.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.mongodb-bson-decimal128" class="reference">

 <h1 class="title">La classe MongoDB\BSON\Decimal128</h1>
 

 <div class="partintro"><p class="verinfo">(mongodb &gt;=1.2.0)</p>


  <div class="section" id="mongodb-bson-decimal128.intro">
   <h2 class="title">Introduction</h2>
   <p class="para">
    Type BSON pour le
    <a href="https://en.wikipedia.org/wiki/Decimal128_floating-point_format" class="link external">&raquo;&nbsp;format à virgule flottante Decimal128</a>,
    qui supporte les nombres avec jusqu&#039;à 34 chiffres décimaux (c.-à-d. chiffres
    significatifs) et une plage d&#039;exposants de −6143 à +6144.
   </p>
   <p class="para">
    Contrairement au type BSON double (c.-à-d. <span class="type"><a href="language.types.float.php" class="type float">float</a></span> en PHP), qui ne
    stocke qu&#039;une approximation des valeurs décimales, le type de données décimal stocke
    la valeur exacte. Par exemple, <code class="literal">MongoDB\BSON\Decimal128(&#039;9.99&#039;)</code>
    a une valeur précise de 9.99 alors qu&#039;un double 9.99 aurait une valeur 
    approximative de 9.9900000000000002131628….
   </p>
   
<blockquote class="note"><p><strong class="note">Note</strong>: 
<span class="simpara">
    <span class="classname"><strong class="classname">MongoDB\BSON\Decimal128</strong></span> n&#039;est compatible qu&#039;avec
    MongoDB 3.4+. Si vous tentez d&#039;utiliser le type BSON avec une ancienne version
    de MongoDB, une erreur sera émise.
</span>
</p></blockquote>

  </div>


  <div class="section" id="mongodb-bson-decimal128.synopsis">
   <h2 class="title">Synopsis de la classe</h2>


   <div class="classsynopsis">
    <span class="ooclass"><strong class="classname"></strong></span>


    <div class="classsynopsisinfo">
     <span class="modifier">final</span>
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">MongoDB\BSON\Decimal128</strong>
     </span>

     <span class="oointerface"><span class="modifier">implements</span> 
       <a href="class.mongodb-bson-decimal128interface.php" class="interfacename">MongoDB\BSON\Decimal128Interface</a></span><span class="oointerface">,  <a href="class.mongodb-bson-type.php" class="interfacename">MongoDB\BSON\Type</a></span><span class="oointerface">,  <a href="class.jsonserializable.php" class="interfacename">JsonSerializable</a></span><span class="oointerface">,  <a href="class.stringable.php" class="interfacename">Stringable</a></span> {</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Méthodes */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><a href="mongodb-bson-decimal128.construct.php" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$value</code></span>)</div>
<div class="methodsynopsis dc-description"><span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><a href="mongodb-bson-decimal128.jsonserialize.php" class="methodname">jsonSerialize</a></span>(): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><a href="mongodb-bson-decimal128.tostring.php" class="methodname">__toString</a></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

   }</div>


  </div>

  <div class="section">
   <h2 class="title">Historique</h2>
   <p class="para">
    <table class="doctable informaltable">
     
      <thead>
       <tr>
        <th>Version</th>
        <th>Description</th>
       </tr>

      </thead>

      <tbody class="tbody">
       
    <tr>
        <td>PECL mongodb 2.0.0</td>
        <td>
            <p class="para">
                Cette classe n’implémente plus l&#039;interface
                <span class="interfacename"><a href="class.serializable.php" class="interfacename">Serializable</a></span>.
            </p>
        </td>
    </tr>


       <tr>
        <td>PECL mongodb 1.12.0</td>
        <td>
         Implémente <span class="interfacename"><a href="class.stringable.php" class="interfacename">Stringable</a></span> pour PHP 8.0+.
        </td>
       </tr>

       <tr>
        <td>PECL mongodb 1.3.0</td>
        <td>
         Implémente <span class="interfacename"><a href="class.mongodb-bson-decimal128interface.php" class="interfacename">MongoDB\BSON\Decimal128Interface</a></span>.
        </td>
       </tr>

       <tr>
        <td>PECL mongodb 1.2.0</td>
        <td>
         Implémente <span class="interfacename"><a href="class.serializable.php" class="interfacename">Serializable</a></span> et
         <span class="interfacename"><a href="class.jsonserializable.php" class="interfacename">JsonSerializable</a></span>.
        </td>
       </tr>

      </tbody>
     
    </table>

   </p>
  </div>

 </div>

 



























<h2>Sommaire</h2><ul class="chunklist chunklist_reference"><li><a href="mongodb-bson-decimal128.construct.php">MongoDB\BSON\Decimal128::__construct</a> — Construit un nouveau Decimal128</li><li><a href="mongodb-bson-decimal128.jsonserialize.php">MongoDB\BSON\Decimal128::jsonSerialize</a> — Retourne une repr&eacute;sentation qui peut &ecirc;tre convertie en JSON</li><li><a href="mongodb-bson-decimal128.tostring.php">MongoDB\BSON\Decimal128::__toString</a> — Retourne la repr&eacute;sentation sous forme de cha&icirc;ne de caract&egrave;res de Decimal128</li></ul>
</div>
<?php manual_footer($setup); ?>