Bug #11519: Problem with bitwise & operator and big integers
| From: | Andreas dot Schwarz at schwarzes dot net | Date: | Sun, 17 Jun 2001 14:16:44 +0000 |
| Subject: | Bug #11519: Problem with bitwise & operator and big integers | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-57043@lists.php.net to get a copy of this message | ||
From: Andreas.Schwarz@schwarzes.net
Operating system: SunOS
PHP version: 4.0.5
PHP Bug Type: *Math Functions
Bug description: Problem with bitwise & operator and big integers
If I use the bitwise "&" operator with an integer (bit 32 is set), the result
is wrong.
<?
/*
** result is wrong (1)*/
$a = 4294901760; /* 11111111111111110000000000000000 */
$b = 1; /* 00000000000000000000000000000001 */
$c = $a & $b;
printf("$c = $a & $b<BR>");
/*
** result is ok (0) */
$a = 2147450880; /* 1111111111111111000000000000000 */
$b = 1; /* 0000000000000000000000000000001 */
$c = $a & $b;
printf("$c = $a & $b<BR>");
?>
--
Edit Bug report at: http://bugs.php.net/?id=11519&edit=1