in reply to Re^3: Infinity and Inf? (MAX_INT)
in thread Infinity and Inf?
The range operator seems only to be implemented for signed 32bits integers
On a 64-bit perl, it handles integers greater than 32-bit.
Though there appears to be a bug. Somewhere in between, the 64-bit integers are being transitioned through an NV (double) before being converted back to integers for the iterator it seems:
for my $p ( 32 .. 64 ) { my $n = 2**$p; printf "\n$p"; printf " $_" for $n .. $n + 2; };; 32 4294967296 4294967297 4294967298 33 8589934592 8589934593 8589934594 34 17179869184 17179869185 17179869186 35 34359738368 34359738369 34359738370 36 68719476736 68719476737 68719476738 37 137438953472 137438953473 137438953474 38 274877906944 274877906945 274877906946 39 549755813888 549755813889 549755813890 40 1099511627776 1099511627777 1099511627778 41 2199023255552 2199023255553 2199023255554 42 4398046511104 4398046511105 4398046511106 43 8796093022208 8796093022209 8796093022210 44 17592186044416 17592186044417 17592186044418 45 35184372088832 35184372088833 35184372088834 46 70368744177664 70368744177665 70368744177666 47 140737488355328 140737488355329 140737488355330 48 281474976710656 281474976710657 281474976710658 49 562949953421312 562949953421313 562949953421314 50 1125899906842624 1125899906842625 1125899906842626 51 2251799813685248 2251799813685249 2251799813685250 52 4503599627370496 4503599627370497 4503599627370498 53 9007199254740992 9007199254740993 9007199254740994 54 18014398509481984 55 36028797018963968 56 72057594037927936 57 144115188075855872 58 288230376151711744 59 576460752303423488 60 1152921504606846976 61 2305843009213693952 62 4611686018427387904 63[Range iterator outside integer range at (eval 21) line 1, <STDIN> l +ine 17.
Good luck in trying to track that bug down :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Infinity and Inf? (MAX_INT)
by ikegami (Patriarch) on Sep 01, 2010 at 16:08 UTC | |
|
Re^5: Infinity and Inf? (MAX_INT)
by LanX (Saint) on Sep 01, 2010 at 15:09 UTC | |
by BrowserUk (Patriarch) on Sep 01, 2010 at 16:42 UTC | |
by LanX (Saint) on Sep 01, 2010 at 17:12 UTC | |
by ikegami (Patriarch) on Sep 01, 2010 at 20:07 UTC | |
by BrowserUk (Patriarch) on Sep 01, 2010 at 17:22 UTC |