Algosim documentation: IsInteger

IsInteger

Tests if an object is an integer.

Syntax

Description

IsInteger(x) returns true iff x is an integer. This is the case iff

For example, the following statements will evaluate to true:

The following statements will evaluate to false:

Examples

f ≔ n ↦ n⋅(n/5 − 1/8)⋅(n/3 − 1/7)
custom function
count(SequenceList(10000) @ f, IsInteger)
188
max(filter(collapse(SequenceList(10000) @ f @ IsInteger), (x ↦ ¬x[1])) @ (x ↦ x[2]))
183
count(SequenceList(10000) @ f, (n ↦ IsInteger(n) ∧ odd(n)))
93
max(filter(collapse(SequenceList(10000) @ f @ (n ↦ IsInteger(n) ∧ odd(n))), (x ↦ ¬x[1])) @ (x ↦ x[2]))
239

See also