isInteger(): test whole-number input
isInteger(x) returns whether x is an integer: a whole number with no fractional component. It is a useful guard for indexes, counts, factorials, and bit operations.
Examples
isInteger(7) is true, while isInteger(7.2) is false. Negative whole numbers are still integers, so add a sign check when an index must be non-negative.
Domain checks
Combine it with isPositive() for positive counts, isZero() when zero needs separate handling, and isFinite() for exceptional values. It is especially helpful before factorial() or bin().
Floating-point caution
Values produced by decimal arithmetic may be extremely close to an integer without being one. Round only when the model authorizes it.