note 97314 added to function.gmp-com
| From: | xo at jdbartlett dot com | Date: | Wed, 14 Apr 2010 05:07:14 +0000 |
| Subject: | note 97314 added to function.gmp-com | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-168216@lists.php.net to get a copy of this message | ||
If you're using one's compliment (bitwise NOT) to flip all $a's bits, don't
forget that you need to use a mask to specify how many bits you expect in your result:
<?php gmp_and(gmp_com('1234'), '2047') ?>
>> 813 // 01100101101 in binary
I chose 2047 because 1234 is an 11-bit binary number and 2047 is the maximum an 11-bit register can
hold:
11111111111 (2047)
10011010010 (1234)
01100101101 (813)
----
Server IP: 69.147.83.197
Probable Submitter: 24.220.196.34
----
Manual Page -- http://www.php.net/manual/en/function.gmp-com.php
Edit -- https://master.php.net/note/edit/97314
Del: integrated -- https://master.php.net/note/delete/97314/integrated
Del: useless -- https://master.php.net/note/delete/97314/useless
Del: bad code -- https://master.php.net/note/delete/97314/bad+code
Del: spam -- https://master.php.net/note/delete/97314/spam
Del: non-english -- https://master.php.net/note/delete/97314/non-english
Del: in docs -- https://master.php.net/note/delete/97314/in+docs
Del: other reasons-- https://master.php.net/note/delete/97314
Reject -- https://master.php.net/note/reject/97314
Search -- https://master.php.net/manage/user-notes.php