<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.gmp.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.gmp-popcount.php',
    1 => 'gmp_popcount',
    2 => 'Comptage de population',
  ),
  'up' => 
  array (
    0 => 'ref.gmp.php',
    1 => 'Fonctions GMP',
  ),
  'prev' => 
  array (
    0 => 'function.gmp-perfect-square.php',
    1 => 'gmp_perfect_square',
  ),
  'next' => 
  array (
    0 => 'function.gmp-pow.php',
    1 => 'gmp_pow',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/gmp/functions/gmp-popcount.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.gmp-popcount" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gmp_popcount</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">gmp_popcount</span> &mdash; <span class="dc-title">Comptage de population</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.gmp-popcount-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gmp_popcount</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.gmp.php" class="type GMP">GMP</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$num</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   Dénombre la population de <code class="parameter">num</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.gmp-popcount-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">num</code></dt>
     <dd>
      <p class="para">
 Un objet <span class="classname"><a href="class.gmp.php" class="classname">GMP</a></span>, un <a href="language.types.integer.php" class="link">entier</a>,
 ou un <a href="language.types.string.php" class="link">chaîne de caractères</a> qui peut être interprété comme un nombre suivant la même logique
 que si la chaîne était utilisée dans <span class="function"><a href="function.gmp-init.php" class="function">gmp_init()</a></span> avec détection automatique de la base (c&#039;est-à-dire lorsque <code class="parameter">base</code> est égal à 0).
</p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.gmp-popcount-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   La population de <code class="parameter">num</code>, sous la forme d&#039;un <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.gmp-popcount-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>gmp_popcount()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$pop1 </span><span style="color: #007700">= </span><span style="color: #0000BB">gmp_init</span><span style="color: #007700">(</span><span style="color: #DD0000">"10000101"</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">); </span><span style="color: #FF8000">// 3 1's<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">gmp_popcount</span><span style="color: #007700">(</span><span style="color: #0000BB">$pop1</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$pop2 </span><span style="color: #007700">= </span><span style="color: #0000BB">gmp_init</span><span style="color: #007700">(</span><span style="color: #DD0000">"11111110"</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">); </span><span style="color: #FF8000">// 7 1's<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">gmp_popcount</span><span style="color: #007700">(</span><span style="color: #0000BB">$pop2</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</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="examplescode"><pre class="examplescode">3
7</pre>
</div>
    </div>
   </div>
  </p>
 </div>


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