...
This compliant solution uses the Bignum module to ensure precise computation. The Bignum module is available in CPAN, but became part of Perl's standard library for version 5.148.
Code Block | ||||
---|---|---|---|---|
| ||||
use bignum; my $x = 10000000000000000; # 1e+16 for (my $y = $x; $y <= $x + 5; $y += 1) { print "$y\n"; } |
...
[Gough 2005] | Section 8.6, "Floating-point issues" |
[IEEE 754 2006] | |
[CPAN] | Florian Ragwitz, bignum |
[Meta CPAN] | perlnumber |
...