Verifying for integer
The function is called isint, and it does exactly what it says: it checks whether you have an integer in front of you or not.
How does it work? It's simple:
isint(x) — returns 1 if x is an honest integer.teger. That is, without commas, dots, tails, exponents and other surprises.
If there is something fractional or crooked in x, you get 0.
To simplify to the limit:
isint(5) ? 1
isint(3.14) ? 0
isint(-7) ? 1
isint(2e3) ? 0 (yes, even like that)
Why is all this necessary? Because firm boundaries are important in the code. If you're writing an algorithm that should only work with integers, it's better to double—check than to curse bugs two nights in a row.
So isint is not "another utilitarian function". This is your little watchman who won't let illegal numbers get into the program. Put it on, and you sleep better.
Help on built-in functions
The rules of programming scripts
Programm options
Color constants