![]() |
|
P is for Practical | |
PerlMonks |
Re: bitwise shift operatorby GrandFather (Saint) |
on Apr 19, 2007 at 01:02 UTC ( #610880=note: print w/replies, xml ) | Need Help?? |
The parenthesis control the execution order so the 1 gets shifted left 31 places, then the result is multiplied by 2. Note that this is a trick to get around Perl's internal representation for integers (on many platforms) as 32 bit quantities. Consider:
Prints:
Although it's not clear to me why 2**32 was not used - your code seems rather odd to me. DWIM is Perl's answer to Gödel
In Section
Seekers of Perl Wisdom
|
|