note 15953 deleted from language.operators.bitwise by danielc

From: Date: Sun, 12 Apr 2009 23:08:25 +0000
Subject: note 15953 deleted from language.operators.bitwise by danielc
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-153130@lists.php.net to get a copy of this message
Note Submitter: joel at alpsgiken dot gr dot jp Reason: 0 ---- All shifts are signed shifts. The shift is performed with the shift count modulo 32, which explains the behavior which looks like a bit rotation, mentioned above. Example: $bit = 0x20000000; print "$bit << 5 == " . ($bit << 5) . $prod . "<br />"; print "$bit >> 5 == " . ($bit >> 5) . $prod . "<br />"; print "$bit >> 37 == " . ($bit >> 37) . $prod . "<br />"; $bit = 4; print "$bit >> 5 == " . ($bit >> 5) . $prod . "<br />"; print "$bit << 5 == " . ($bit << 5) . $prod . "<br />"; print "$bit << 37 == " . ($bit << 37) . $prod . "<br />"; Results: 536870912 << 5 == 0 536870912 >> 5 == 16777216 536870912 >> 37 == 16777216 4 >> 5 == 0 4 << 5 == 128 4 << 37 == 128

« previous php.notes (#153130) next »