in reply to Re^2: Bitwise & stopped working?
in thread Bitwise & stopped working?
$c=00000000, $hash=03FFFFFF => $hash=FFFFFFFF 32-bit Perl $c=00000000, $hash=03FFFFFF => $hash=FBFEFFC1 64-bit Perl
That doesn't fix the problem, even if you fix the two bugs you introduced. Quote perlop,
The result of overflowing the range of the integers is undefined because it is undefined also in C.
($hash << 6) should be (($hash & 0x03ffffff) << 6)
($hash << 16) should be (($hash & 0x0000ffff) << 16)
Update: My original counter example was bad. Fixed.
|
|---|