It would be a premature pessimisation to move to using Math::BigInt on a 32-bit integer machine until you've exploited the ability of doubles to hold 53-bit integers accurately. That would make the breakpoint: 9007199254740992.
If there is any chance of a version of perl using something other than a 64-bit double, then you can determine the break point dynamically using:
my $n = 2; $n *=2 until $n+0.5 == $n; $n *=2; print $n;
In reply to Re: portably finding max integer
by BrowserUk
in thread portably finding max integer
by martin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |