isInteger

isInteger(x)

Try it yourself:


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.

Try Is Integer in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions