in reply to Re^4: Largest integer in 64-bit perl
in thread Largest integer in 64-bit perl
The fact that the flags change from (NOK,pNOK) to (IOK,pIOK) suggests to me that the NV has been promoted to an IV.D:\>perl -MDevel::Peek -le "$x = (2 ** 53) - 1; Dump $x; $x++; Dump $x +; $x++; Dump $x; $x++; Dump $x;" SV = NV(0x28e88c5a2f8) at 0x28e88c5a310 REFCNT = 1 FLAGS = (NOK,pNOK) NV = 9007199254740991 SV = PVNV(0x28e88c24e10) at 0x28e88c5a310 REFCNT = 1 FLAGS = (IOK,pIOK) IV = 9007199254740992 NV = 9007199254740991 PV = 0 SV = PVNV(0x28e88c24e10) at 0x28e88c5a310 REFCNT = 1 FLAGS = (IOK,pIOK) IV = 9007199254740993 NV = 9007199254740991 PV = 0 SV = PVNV(0x28e88c24e10) at 0x28e88c5a310 REFCNT = 1 FLAGS = (IOK,pIOK) IV = 9007199254740994 NV = 9007199254740991 PV = 0
I don't regard it as all that important, but it probably shouldn't do that.D:\>perl -MMath::BigInt -le "$x = Math::BigInt->new(2.3); print $x; pr +int ref($x);" NaN Math::BigInt D:\>perl -MMath::BigInt -le "$x = Math::BigInt->new(1) / 0; print $x; +print ref($x);" inf Math::BigInt
Cheers,D:\>perl -MMath::BigInt -le "$x = Math::BigInt->new(1) / inf; print $x +; print ref($x);" 0 Math::BigInt D:\>perl -MMath::BigInt -le "$x = Math::BigInt->new(1) / -inf; print $ +x; print ref($x);" -1 Math::BigInt
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Largest integer in 64-bit perl
by ikegami (Patriarch) on May 27, 2025 at 20:04 UTC | |
Re^6: Largest integer in 64-bit perl
by cavac (Prior) on Jun 02, 2025 at 14:49 UTC | |
Re^6: Largest integer in 64-bit perl
by ikegami (Patriarch) on Jun 02, 2025 at 15:44 UTC |