# isInteger() Function & Examples

Use the isInteger() utils function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## isInteger

#### isInteger(x)

Try it yourself:

```calculio
isInteger(2)
isInteger(3.5)
isInteger([3, 0.5, -2])
```

---

## 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()](https://calcul.io/function/isPositive/index.md) for positive counts, [isZero()](https://calcul.io/function/isZero/index.md) when zero needs separate handling, and [isFinite()](https://calcul.io/function/isFinite/index.md) for exceptional values. It is especially helpful before [factorial()](https://calcul.io/function/factorial/index.md) or [bin()](https://calcul.io/function/bin/index.md).

## 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.

[All functions](https://calcul.io/functions/index.md)
