Possible Duplicate:
How do I create or test for NaN or infinity in Perl?
How can I check, if scalar holds inf
value?
I check NaN as $scalar != $scalar
, what to do with inf
?
$scalar == inf
does not work, since inf
is a bareword
Possible Duplicate:
How do I create or test for NaN or infinity in Perl?
How can I check, if scalar holds inf
value?
I check NaN as $scalar != $scalar
, what to do with inf
?
$scalar == inf
does not work, since inf
is a bareword
I found a dirty hack right now.
($scalar eq "inf")
Does anything cleaner exist?
you can use this to check for infinity:
$scalar < 9**9**9
that constant is so large that it will be interpreted as infinite by Perl