<?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 => 'tr',
  ),
  'this' => 
  array (
    0 => 'function.gmp-setbit.php',
    1 => 'gmp_setbit',
    2 => 'Set bit',
  ),
  'up' => 
  array (
    0 => 'ref.gmp.php',
    1 => 'GMP İşlevleri',
  ),
  'prev' => 
  array (
    0 => 'function.gmp-scan1.php',
    1 => 'gmp_scan1',
  ),
  'next' => 
  array (
    0 => 'function.gmp-sign.php',
    1 => 'gmp_sign',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/gmp/functions/gmp-setbit.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

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

 </div>

 <div class="refsect1 description" id="refsect1-function.gmp-setbit-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gmp_setbit</strong></span>(<span class="methodparam"><span class="type"><a href="class.gmp.php" class="type GMP">GMP</a></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="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$value</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></span></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   Sets bit <code class="parameter">index</code> in <code class="parameter">num</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.gmp-setbit-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">num</code></dt>
     <dd>
      <p class="para">
       A <span class="classname"><a href="class.gmp.php" class="classname">GMP</a></span> object.
      </p>
     </dd>
    
    
     <dt><code class="parameter">index</code></dt>
     <dd>
      <p class="para">
       The index of the bit to set.  Index 0 represents the least significant bit.
      </p>
     </dd>
    
    
     <dt><code class="parameter">value</code></dt>
     <dd>
      <p class="para">
       True to set the bit (set it to 1/on); false to clear the bit (set it to 0/off).
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.gmp-setbit-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="para">
   Hiçbir değer dönmez.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.gmp-setbit-examples">
  <h3 class="title">Örnekler</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Örnek 1 <span class="function"><strong>gmp_setbit()</strong></span> example - 0 index</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$a </span><span style="color: #007700">= </span><span style="color: #0000BB">gmp_init</span><span style="color: #007700">(</span><span style="color: #DD0000">"2"</span><span style="color: #007700">); </span><span style="color: #FF8000">//<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">), </span><span style="color: #DD0000">' -&gt; 0b'</span><span style="color: #007700">, </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">gmp_setbit</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">); </span><span style="color: #FF8000">// 0b10 now becomes 0b11<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">), </span><span style="color: #DD0000">' -&gt; 0b'</span><span style="color: #007700">, </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">, </span><span style="color: #0000BB">2</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>
Yukarıdaki örneğin çıktısı:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">2 -&gt; 0b10
3 -&gt; 0b11</pre>
</div>
    </div>
   </div>

   <div class="example" id="example-2">
    <p><strong>Örnek 2 <span class="function"><strong>gmp_setbit()</strong></span> example - 1 index</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$a </span><span style="color: #007700">= </span><span style="color: #0000BB">gmp_init</span><span style="color: #007700">(</span><span style="color: #DD0000">"0xfd"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">), </span><span style="color: #DD0000">' -&gt; 0b'</span><span style="color: #007700">, </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">gmp_setbit</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">); </span><span style="color: #FF8000">// index starts at 0<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">), </span><span style="color: #DD0000">' -&gt; 0b'</span><span style="color: #007700">, </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">, </span><span style="color: #0000BB">2</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>
Yukarıdaki örneğin çıktısı:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">253 -&gt; 0b11111101
255 -&gt; 0b11111111</pre>
</div>
    </div>
   </div>

   <div class="example" id="example-3">
    <p><strong>Örnek 3 <span class="function"><strong>gmp_setbit()</strong></span> example - clearing a bit</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$a </span><span style="color: #007700">= </span><span style="color: #0000BB">gmp_init</span><span style="color: #007700">(</span><span style="color: #DD0000">"0xff"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">), </span><span style="color: #DD0000">' -&gt; 0b'</span><span style="color: #007700">, </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">gmp_setbit</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">); </span><span style="color: #FF8000">// clear bit at index 0<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">), </span><span style="color: #DD0000">' -&gt; 0b'</span><span style="color: #007700">, </span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">, </span><span style="color: #0000BB">2</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>
Yukarıdaki örneğin çıktısı:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">255 -&gt; 0b11111111
254 -&gt; 0b11111110</pre>
</div>
    </div>
   </div>

  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.gmp-setbit-notes">
  <h3 class="title">Notlar</h3>
  <blockquote class="note"><p><strong class="note">Bilginize</strong>: 
   <p class="para">
    Unlike most of the other GMP functions, <span class="function"><strong>gmp_setbit()</strong></span>
    must be called with a GMP object that already exists (using
    <span class="function"><a href="function.gmp-init.php" class="function">gmp_init()</a></span> for example). One will not be
    automatically created.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.gmp-setbit-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.gmp-clrbit.php" class="function" rel="rdfs-seeAlso">gmp_clrbit()</a> - Clear bit</span></li>
    <li><span class="function"><a href="function.gmp-testbit.php" class="function" rel="rdfs-seeAlso">gmp_testbit()</a> - Tests if a bit is set</span></li>
   </ul>
  </p>
 </div>


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