davidfilmer has asked for the wisdom of the Perl Monks concerning the following question:
Hello Masters!
I am trying to liberate a Java program into Perl.
It does a bunch of weird bitwise operations which I'm not very familiar with, but it seems the "<<"operator (left-shift) does not appear to be acting the same way.
I have this bit of Java code, which is known to work as-expected:
In Perl, I rendered it like this:
Can anyone see any reason why my Perl would not produce equivalent results as the Java code?
Thanks!
RESULT: -268435456public class hashTest { public static void main(String[] args) { long HIGH_BITS = 0xFFFFFFFF << 28; System.out.print( HIGH_BITS ); } }
In Perl, I rendered it like this:
RESULT: 4026531840#!/usr/bin/perl my $HIGH_BITS = 0xFFFFFFFF << 28; print( $HIGH_BITS );
Can anyone see any reason why my Perl would not produce equivalent results as the Java code?
Thanks!
Back to
Seekers of Perl Wisdom