"be consistent" | |
PerlMonks |
Re^4: How to check Inputs if Numeric (eq 0+)by tye (Sage) |
on Mar 07, 2014 at 03:55 UTC ( [id://1077322]=note: print w/replies, xml ) | Need Help?? |
Not bad, especially given the simplicity. More potential false negatives to go with jdporter's.
Update: It successfully detects if $input is (primarily) holding a numeric value (an IV or NV, how Perl stores an integer and floating point, respectively) or is holding a string value that equals the canonical string representation of any possible Perl numeric value. So I don't believe that there are any false positives. The false negatives are the many ways to reasonably represent a numeric value that aren't Perl's canonical representation. - tye
In Section
Seekers of Perl Wisdom
|
|