mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
gmp_setbit clarification by joey
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@331023 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
698cad0c1d
commit
ac75c7cd15
1 changed files with 22 additions and 5 deletions
|
@ -10,7 +10,7 @@
|
|||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>gmp_setbit</methodname>
|
||||
<methodparam><type>resource</type><parameter>a</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter role="reference">a</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>index</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>set_clear</parameter><initializer>true</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
@ -27,7 +27,7 @@
|
|||
<term><parameter>a</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The number being set to.
|
||||
The value to modify.
|
||||
</para>
|
||||
&gmp.parameter;
|
||||
</listitem>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The set bit.
|
||||
The index of the bit to set. Index 0 represents the least significant bit.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -44,8 +44,7 @@
|
|||
<term><parameter>set_clear</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Defines if the bit is set to 0 or 1. By default the bit is set to
|
||||
1. Index starts at 0.
|
||||
True to set the bit (set it to 1); false to clear the bit (set it to 0).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -78,6 +77,24 @@ echo gmp_strval($a) . "\n";
|
|||
<screen>
|
||||
<![CDATA[
|
||||
255
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title><function>gmp_setbit</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$a = gmp_init("2"); //
|
||||
gmp_setbit($a, 0); // 0b10 now becomes 0b11
|
||||
echo gmp_strval($a) . "\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
3
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue