BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:
Using a 64-bit build of perl 5.18:
Given:
C:\test>\perl5.18\perl\bin\perl.exe -E"printf qq[%u\n], 2**63" 9223372036854775808
And this fails:
C:\test>\perl5.18\perl\bin\perl.exe -E"1 for 1 .. 9223372036854775808" Range iterator outside integer range at -e line 1.
And this succeeds:
C:\test>\perl5.18\perl\bin\perl.exe -E"1 for 1 .. 9223372036854775808 +- 1"
Why does this fail?:
C:\test>\perl5.18\perl\bin\perl.exe -E"1 for 1 .. 2**63 - 1" Range iterator outside integer range at -e line 1.
And this fail?:
C:\test>\perl5.18\perl\bin\perl.exe -E"1 for 1 .. 2**63 - 512" Range iterator outside integer range at -e line 1.
But this succeed?:
C:\test>\perl5.18\perl\bin\perl.exe -E"1 for 1 .. 2**63-513"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Range iterator outside integer range ... Why?
by Anonymous Monk on Jan 16, 2015 at 16:02 UTC | |
by BrowserUk (Patriarch) on Jan 16, 2015 at 16:17 UTC | |
by Eily (Monsignor) on Jan 16, 2015 at 16:27 UTC |