could someone point me to a good source where and how the constants Inf and Infinity can be used in Perl?
I tried to define a lazy iteration and I know that I can redefine the constant for my needs
DB<6> $x=0;for (1..Inf) { print; last if $x++ >5} Range iterator outside integer range at (eval 10)[/usr/share/perl/5.10 +/perl5db.pl:638] line 2. DB<7> sub Inf() {1000} DB<8> $x=0;for (1..Inf) { print; last if $x++ >5} 1234567
But I would be interested to know the canonical/intended way to use those constants, before messing around with internals!
Unfortunately grepping thru the perlocs didn't show much information.
It seems to be a feature of Math::BigInt but why can I see the constant without using BigInt???
There are also confusing references to a IEEE 754 standard. In JS a division by zero results to Infinity, but in Perl it's an error?
Please enlighten me about what is happening here...
Cheers Rolf
In reply to Infinity and Inf? by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |