in reply to Re: using int and the range function
in thread using int and the range function

I think this is closest to the OP's intent, because it also detects if the number doesn't fit into an "integer".

But I'd change the if condition to
... if $input eq int $input;
because for humans that's easier to parse than
... if int $input eq $input;

Replies are listed 'Best First'.
Re^3: using int and the range function
by Laurent_R (Canon) on Jan 16, 2015 at 07:49 UTC
    Yes, you are right, it makes precedence comprehension a little bit easier. I actually thought of changing it the way you put it when I posted it, but since I tested it under the debugger the way I wrote it, I prefered not to change my post to something untested. In a real program, I would probably change it to make it clearer.
    Je suis Charlie.