Subject: | Time to support larger numbers |
The current documentation includes:
Note: TERA or higher are not implemented because of integer overflows on 32-bit systems.
Note: TEBI or higher are not implemented because of integer overflows on 32-bit systems.
It's time to lift this restriction. Multi-terabyte disks have been common for years, as have 64-bit systems.
On 32-bit systems, use bignum or Math::BigInt can easily handle 64-bit quantities.
You can lazy-load Math::BigInt only if required, e.g.
my $big_suffixes = 1;
my $use_bigint;
if( ~0 < 0xffffffff_ffffffff && !$use_bigint && $value > ~0) {
$use_bigint = $big_suffixes = eval { require Math::BigInt; Math::BigInt->import( try => 'GMP'; 1 };
# Actually, the eval shouldn't fail, since Math::BigInt is a Perl 5 core module.
}
if( $big_suffixes ) {
add & test for Terra, exa, peta, zeta
Do the math with Math::BigInts if( $use_bigint );
}