ID: 6368 Updated by: yohgaki Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Feature/Change Request Operating System: Linux 2.2.16 PHP Version: 4.0.1pl2 New Comment:
Is this feasible? I think it's not, unless we support unsinged int/long type...... And it will be more confusing than bitwise operation.... Won't change. Please feel free to reopen if you are willing to discuss more about this. Previous Comments: ------------------------------------------------------------------------ [2000-08-26 13:41:42] [EMAIL PROTECTED] And signed shift operations is not a bug, moving to feature request. ------------------------------------------------------------------------ [2000-08-26 13:40:57] [EMAIL PROTECTED] Why did you decide that -2 is 10000000000000000000000000000001? It isn't. ------------------------------------------------------------------------ [2000-08-26 12:58:05] [EMAIL PROTECTED] Sorry, there's an error in my Bug report. When I do a "~1" i get -2, not 2. Sorry again... ------------------------------------------------------------------------ [2000-08-26 12:56:05] [EMAIL PROTECTED] Maybe i'm just too stupid, but this one is strange: The logical operator ~ (bitwise NOT) does not behave as expected. When doing a "~1" (00000000000000000000000000000001), i get 2 (10000000000000000000000000000001) so it only seems to invert the first bit?! Furthermore when doing some simple mathematicaloperations, PHP behaves extremely annoing. Right-shifting (>>) a negative number will always produce a negative result, i.e. the +/- bit gets not shifted. Although you are right when you claim that this one is ok, there are situations when you want the sign bit to get also shifted, and there seems to be no simple way for doing that in PHP :-( ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=6368&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]