php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11519 Problem with bitwise & operator and big integers
Submitted: 2001-06-17 10:16 UTC Modified: 2001-06-17 14:08 UTC
From: Andreas dot Schwarz at schwarzes dot net Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 4.0.5 OS: SunOS
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Andreas dot Schwarz at schwarzes dot net
New email:
PHP Version: OS:

 

 [2001-06-17 10:16 UTC] Andreas dot Schwarz at schwarzes dot net
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>");
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-17 14:08 UTC] sniper@php.net
See this bug report for reason why this is bogus report:

http://www.php.net/bugs.php?id=7755&edit=1

Also I suggest you READ the instructions about submitting
bug reports BEFORE you submit one.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 18:01:31 2024 UTC