in reply to undef number?
Output:use constant INF => 9**9E9; print INF;
1.#INF
Oddly enough, comparisons still work, in every Perl version I've tested so far:
Result:use constant INF => 9**9E9; local($\, $,) = ("\n", "\t"); for my $e (305 .. 310) { my $n = 10**$e; print $e, $n, INF > $n || 0, -$n, -(INF) < - $n || 0; }
(On another perl I see "inf" instead of "1.#INF", but other results are identical.)305 1e+305 1 -1e+305 1 306 1e+306 1 -1e+306 1 307 1e+307 1 -1e+307 1 308 1e+308 1 -1e+308 1 309 1.#INF 0 -1.#INF 0 310 1.#INF 0 -1.#INF 0
As you can see, even the unary minus sign (negate) still works as it ought to.
Unfortunately(?) INF is still not bigger than INF, but... I guess that won't matter any more, will it?
|
|---|