- or download this
use Config qw( %Config );
use List::Util qw( max );
my $max = max( ~0+1, eval( $Config{ nv_overflows_integers_at } ) );
- or download this
[+/-]1._____..._____ * 2**____
- or download this
__52 bits__
/ \
...
1.00000...000001 * 2**53 But we have limited number of bits
--------------------------
1.00000...00000 * 2**53 Original large power of two
- or download this
$ perl -MB=svref_2object,SVf_IVisUV,SVf_NOK -e'
$i = 0;
...
: "IV\n"; # Signed int
'
IV
- or download this
$ perl -MConfig -MB=svref_2object,SVf_IVisUV,SVf_NOK -e'
$i = hex("7F".("FF"x($Config{ivsize}-2))."FD");
...
IV 2147483647 <-- 2**31 - 1 Largest IV
UV 2147483648
UV 2147483649
- or download this
IV 9223372036854775806
IV 9223372036854775807 <-- 2**63 - 1 Largest IV
UV 9223372036854775808
UV 9223372036854775809
- or download this
$ perl -V:[in]vsize
ivsize='4'; # 32-bit integers
nvsize='8'; # 64-bit floats
- or download this
$ perl -V:[in]vsize
ivsize='8'; # 64-bit integers
nvsize='8'; # 64-bit floats
- or download this
$ perl -MConfig -MB=svref_2object,SVf_IVisUV,SVf_NOK -e'
$i = eval($Config{nv_overflows_integers_at}) - 3;
...
NV 9007199254740991 Precision required as a float:
NV 9007199254740992 <-- 2**53 1 bit
NV 9007199254740992 <-- 2**53 + 1 54 bits, but only 53 are available
- or download this
$ perl -MConfig -MB=svref_2object,SVf_IVisUV,SVf_NOK -e'
$i = hex(("FF"x($Config{ivsize}-1))."FD");
...
UV 18446744073709551615 <-- 2**64 - 1 Largest UV
NV 18446744073709551616 <-- 2**64 1 bit of precision required
NV 18446744073709551616 <-- 2**64 + 1 65, but only 53 are available