<?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 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.gmp-testbit.php',
    1 => 'gmp_testbit',
    2 => 'Tests if a bit is set',
  ),
  'up' => 
  array (
    0 => 'ref.gmp.php',
    1 => 'GMP Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.gmp-sub.php',
    1 => 'gmp_sub',
  ),
  'next' => 
  array (
    0 => 'function.gmp-xor.php',
    1 => 'gmp_xor',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/gmp/functions/gmp-testbit.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.gmp-testbit" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gmp_testbit</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">gmp_testbit</span> &mdash; <span class="dc-title">Tests if a bit is set</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.gmp-testbit-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gmp_testbit</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="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$index</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Tests if the specified bit is set.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.gmp-testbit-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">num</code></dt>
     <dd>
      <p class="para">
 Ein <span class="classname"><a href="class.gmp.php" class="classname">GMP</a></span>-Object, ein <a href="language.types.integer.php" class="link">Integer</a> oder eine Zeichenkette,
 die als Zahl interpretiert werden kann, wobei die gleiche Logik gilt, als ob
 die Zeichenkette in <span class="function"><a href="function.gmp-init.php" class="function">gmp_init()</a></span> mit automatischer Erkennung
 der Basis verwendet würde (d. h. wenn <code class="parameter">base</code> gleich 0 ist).
</p> 
     </dd>
    
    
     <dt><code class="parameter">index</code></dt>
     <dd>
      <p class="para">
       The bit to test
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.gmp-testbit-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> if the bit is set in <code class="parameter">num</code>, 
   otherwise <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.gmp-testbit-errors">
  <h3 class="title">Fehler/Exceptions</h3>
  <p class="para">
   An <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> level error is issued when 
   <code class="parameter">index</code> is less than zero, and <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
   is returned.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.gmp-testbit-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>gmp_testbit()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$n </span><span style="color: #007700">= </span><span style="color: #0000BB">gmp_init</span><span style="color: #007700">(</span><span style="color: #DD0000">"1000000"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">gmp_testbit</span><span style="color: #007700">(</span><span style="color: #0000BB">$n</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">gmp_setbit</span><span style="color: #007700">(</span><span style="color: #0000BB">$n</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">gmp_testbit</span><span style="color: #007700">(</span><span style="color: #0000BB">$n</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt folgende Ausgabe:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">bool(false)
bool(true)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.gmp-testbit-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.gmp-setbit.php" class="function" rel="rdfs-seeAlso">gmp_setbit()</a> - Set bit</span></li>
    <li><span class="function"><a href="function.gmp-clrbit.php" class="function" rel="rdfs-seeAlso">gmp_clrbit()</a> - Clear bit</span></li>
   </ul>
  </p>
 </div>

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