note 76719 added to function.gmp-setbit
| From: | bluej100 at gmail | Date: | Fri, 27 Jul 2007 16:07:47 +0000 |
| Subject: | note 76719 added to function.gmp-setbit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128984@lists.php.net to get a copy of this message | ||
The third parameter is somewhat confusingly named; it would probably be better described as
"$set_state". If true, it sets the bit to 1. If false, it sets the bit to 0. Default is
true.
<?php
$num = gmp_init(1);
gmp_setbit($num, 1);
echo 'gmp_setbit(1, 1): '.gmp_strval($num, 2)."\n"; // 11
$num = gmp_init(1);
gmp_setbit($num, 1, true);
echo 'gmp_setbit(1, 1, true): '.gmp_strval($num, 2)."\n"; // 11
$num = gmp_init(1);
gmp_setbit($num, 0, false);
echo 'gmp_setbit(1, 0, false): '.gmp_strval($num, 2)."\n"; // 0
?>
----
Server IP: 209.41.74.194
Probable Submitter: 63.253.43.10
----
Manual Page -- http://www.php.net/manual/en/function.gmp-setbit.php
Edit -- https://master.php.net/note/edit/76719
Del: integrated -- https://master.php.net/note/delete/76719/integrated
Del: useless -- https://master.php.net/note/delete/76719/useless
Del: bad code -- https://master.php.net/note/delete/76719/bad+code
Del: spam -- https://master.php.net/note/delete/76719/spam
Del: non-english -- https://master.php.net/note/delete/76719/non-english
Del: in docs -- https://master.php.net/note/delete/76719/in+docs
Del: other reasons-- https://master.php.net/note/delete/76719
Reject -- https://master.php.net/note/reject/76719
Search -- https://master.php.net/manage/user-notes.php