Skip Menu |

This queue is for tickets about the Number-Format CPAN distribution.

Report information
The Basics
Id: 124713
Status: open
Priority: 0/
Queue: Number-Format

People
Owner: Nobody in particular
Requestors: tlhackque [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.75
Fixed in: (no value)



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 ); }
On Wed Mar 07 12:20:39 2018, tlhackque wrote: Show quoted text
> 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 ); > }
I'm bumping this because I would like to use it on bigger numbers too. Right now, it is limited to numbers 99,999,999 and lower. I have bigger numbers than that. LA