in reply to Re: Incrementing "Infinity" bug
in thread Incrementing "Infinity" bug
> As you were probably aware, warnings alert you and strictures disallow it altogether:
Yes, I became aware after posting the first time.
I expected inf and it's brothers² to be constants because of their magic behavior when being numified.
Introducing constants¹ for inf, -inf and NaN (even all uppercase like INF) would help clarifying the situation.
Cheers Rolf
( addicted to the Perl Programming Language)
¹) like I demonstrated here
²) every string starting with inf (no matter if upper or lower case) numifies to inf:
DB<106> $a="Infinity"+0 => "inf" DB<109> $a="Inftyddssssd"+0 => "inf" DB<110> $a="Inf"+0 => "inf" DB<111> $a="InF"+0 => "inf"
UPDATE: line 109 with"Inftyddssssd" fails with activated warnings, anything else with lc($else) ~~ ['inf','infinity'] won't
DB<123> use warnings; $a='InFiNiTy'+0 => "inf" DB<125> use warnings;$a="Inftyddssssd"+0 Argument "Inftyddssssd" isn't numeric in addition (+) at (eval 74)[mul +ti_perl5db.pl:644] line 2.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Incrementing "Infinity" bug
by kcott (Archbishop) on Mar 25, 2013 at 16:28 UTC | |
by LanX (Saint) on Mar 25, 2013 at 16:49 UTC |