📄 function.gmp-clrbit.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Clear bit</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.gmp-and.html">gmp_and</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.gmp-cmp.html">gmp_cmp</a></div> <div class="up"><a href="ref.gmp.html">GMP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.gmp-clrbit" class="refentry"> <div class="refnamediv"> <h1 class="refname">gmp_clrbit</h1> <p class="verinfo">(PHP 4 >= 4.0.4, PHP 5)</p><p class="refpurpose"><span class="refname">gmp_clrbit</span> — <span class="dc-title">Clear bit</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type"><span class="type void">void</span></span> <span class="methodname"><b><b>gmp_clrbit</b></b></span> ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter reference">&$a</tt></span> , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$index</tt></span> )</div> <p class="para rdfs-comment"> Clears (sets to 0) bit <i><tt class="parameter">index</tt></i> in <i><tt class="parameter">a</tt></i>. The index starts at 0. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">a</tt></i></span> <dd> <p class="para">It can be either a GMP number <a href="language.types.resource.html" class="type resource">resource</a>, or a numeric string given that it is possible to convert the latter to a number.</p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">index</tt></i></span> <dd> <p class="para">It can be either a GMP number <a href="language.types.resource.html" class="type resource">resource</a>, or a numeric string given that it is possible to convert the latter to a number.</p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> A GMP number <a href="language.types.resource.html" class="type resource">resource</a>. </p> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <div class="example"> <p><b>Example #1 <b>gmp_clrbit()</b> example</b></p> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?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 /></span><span style="color: #0000BB">gmp_clrbit</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">// index starts at 0, least significant bit<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">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span></span></code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents"><pre><div class="cdata"><pre>254</pre></div> </pre></div> </div> </div> <div class="refsect1 notes"> <h3 class="title">Notes</h3> <blockquote><p><b class="note">Note</b>: Unlike most of the other GMP functions, <b>gmp_clrbit()</b> must be called with a GMP resource that already exists (using <a href="function.gmp-init.html" class="function">gmp_init()</a> for example). One will not be automatically created. <br /> </p></blockquote> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="function.gmp-setbit.html" class="function" rel="rdfs-seeAlso">gmp_setbit()</a></li> <li class="member"><a href="function.gmp-testbit.html" class="function" rel="rdfs-seeAlso">gmp_testbit()</a></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.gmp-and.html">gmp_and</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.gmp-cmp.html">gmp_cmp</a></div> <div class="up"><a href="ref.gmp.html">GMP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -