Dear fellow monks,

I can have an integer in Perl which exceeds 32 bits:

for ($i=0;$i<60;$i++) { print "$i: "; print 1 << $i; print "\n"; }
Output :-
0: 1 1: 2 2: 4 3: 8 4: 16 5: 32 6: 64 7: 128 8: 256 9: 512 10: 1024 11: 2048 12: 4096 13: 8192 14: 16384 15: 32768 16: 65536 17: 131072 18: 262144 19: 524288 20: 1048576 21: 2097152 22: 4194304 23: 8388608 24: 16777216 25: 33554432 26: 67108864 27: 134217728 28: 268435456 29: 536870912 30: 1073741824 31: 2147483648 32: 1 33: 2 34: 4 35: 8 36: 16 37: 32 38: 64 39: 128 40: 256 41: 512 42: 1024 43: 2048 44: 4096 45: 8192 46: 16384 47: 32768 48: 65536 49: 131072 50: 262144 51: 524288 52: 1048576 53: 2097152 54: 4194304 55: 8388608 56: 16777216 57: 33554432 58: 67108864 59: 134217728
I don't find any documentation which explains the above behaviour. Could anyone explain me the above.

"Keep pouring your ideas"

In reply to Left shift operation done more than 32 times by jesuashok

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.