Bug #17116 Updated: Bitwise & does not give expected results for positive numbers
| From: | lindsay dot marshall at ncl dot ac dot uk | Date: | Thu, 09 May 2002 12:32:33 +0000 |
| Subject: | Bug #17116 Updated: Bitwise & does not give expected results for positive numbers | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-7318@lists.php.net to get a copy of this message | ||
ID: 17116
Updated by: lindsay.marshall@ncl.ac.uk
-Summary: Bitwise & does not give expected results
Reported By: lindsay.marshall@ncl.ac.uk
Status: Open
Bug Type: Math related
-Operating System: redahat 7.2
+Operating System: redhat 7.2
PHP Version: 4.2.0
New Comment:
Oh, and before you say "BOGUS - see 7755"
1) I am not using negative integers
2) I think that 7755 is a serious bug and needs to be fixed properly as
someone else commented.
3) It is clearly intermittent or at least depends on past history in
some way.
Previous Comments:
------------------------------------------------------------------------
[2002-05-09 08:27:17] lindsay.marshall@ncl.ac.uk
I just tried the following:
$a1 = $r->status;
$a2 = $current->mask;
echo $a1.' '.$a2.' '.($a1&$a2);
And it still prints out 8191 7 0
I feel as though I am doing something really stupid here, but cannot
for the life of me see what it is.
------------------------------------------------------------------------
[2002-05-09 08:17:02] lindsay.marshall@ncl.ac.uk
I have a piece of code that effectively does this :
$r->f = 8191;
$c->m = 7;
$r->f & $c->m returns 0!!
The above code works fine when tested standalone, but the equivalent
code in my program generates 0. I can write ;
echo $r->status.' '.$current->mask.'
'.($r->status&$current->mask);
and the output I get is
8191 7 0
If I write :
$a1=7;$a2=8191;
echo $r->status.' '.$current->mask.' '.($a1&$a2);
I get
8191 7 7
Something is getting confused somewhere!!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17116&edit=1