sub is_integer {
defined $_[0] && $_[0] =~ /^[+-]?\d+$/;
}
sub is_float {
defined $_[0] && $_[0] =~ /^[+-]?\d+(\.\d+)?$/;
}
For the code mentioned above, if we give input as 999999999999999999999999999999999999999999, it is giving output as not real number.
Can anyone help me in this regard why it is behaving like that?
I forgot to mention one more thing :
if i am using this code for $x as above value
if($x > 0 || $x <= 0 ) { print "Real"; }
output is real.
how is it possible? can anyone explain???