php-documentation-list | 2003101
Date: 10/15/03
- Next message: moriyoshi <email protected>: "[PHP-DOC] #25877 [Opn]: >> operator bug for negative LOP"
- Previous message: Mehdi Achour: "Re: [PHP-DOC] Re: quickref.swf"
- Next in thread: moriyoshi <email protected>: "[PHP-DOC] #25877 [Opn]: >> operator bug for negative LOP"
- Maybe reply: moriyoshi <email protected>: "[PHP-DOC] #25877 [Opn]: >> operator bug for negative LOP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 25877
Updated by: moriyoshi <email protected>
Reported By: cestmirl at freeside dot sk
Status: Open
-Bug Type: Math related
+Bug Type: Documentation problem
Operating System: Linux Debian, Win32
PHP Version: 4.3.3
New Comment:
Since PHP doesn't support unsigned shift operations that are
represented by '<<<' or '>>>' in the C language, bit shift operations
are done in "sign-respectful" manner, where the most significant bit
will never be changed. This is expected behaviour, but not documented
yet.
Previous Comments:
------------------------------------------------------------------------
[2003-10-15 07:40:14] cestmirl at freeside dot sk
Description:
------------
Bitwise shift right operator returns negative result (most significant
bit set) for negative input (left operand).
Following assert fails (though should NOT)
assert((1 << 31 >> 31) == 1);
Reproduce code:
---------------
assert((1 << 31 >> 31) == 1);
Actual result:
--------------
assertion failed
------------------------------------------------------------------------
-- Edit this bug report at http://bugs.php.net/?id=25877&edit=1
- Next message: moriyoshi <email protected>: "[PHP-DOC] #25877 [Opn]: >> operator bug for negative LOP"
- Previous message: Mehdi Achour: "Re: [PHP-DOC] Re: quickref.swf"
- Next in thread: moriyoshi <email protected>: "[PHP-DOC] #25877 [Opn]: >> operator bug for negative LOP"
- Maybe reply: moriyoshi <email protected>: "[PHP-DOC] #25877 [Opn]: >> operator bug for negative LOP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

