in reply to Difference between Perl and Java for << operator?
Don't know much about Java, but
> I have this bit of Java code, which is known to work as-expected:
> RESULT: -268435456
How can a negative result be considered expected?
I think you should take care that both sides are unsigned integers of same size.
FWIW I don't get your Perl result
DB<16> say $x= 0xFFFFFFFF << 28 1152921504338411520
so 64bit Perl seems to matter too.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Difference between Perl and Java for << operator?
by GrandFather (Saint) on Jul 30, 2021 at 04:00 UTC | |
by LanX (Saint) on Jul 30, 2021 at 08:28 UTC | |
by NERDVANA (Deacon) on Jul 30, 2021 at 12:07 UTC |
In Section
Seekers of Perl Wisdom