This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

IntegerQ

IntegerQ[expr]
gives True if expr is an integer, and False otherwise.
  • Simplify[exprIntegers] can be used to try to determine whether an expression is mathematically equal to an integer.
IntegerQ tests whether an expression is explicitly an integer:
IntegerQ tests whether an expression is explicitly an integer:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Test whether an array consists of all integers:
Make a test for Gaussian integers:
Integers have head Integer:
An expression may have head Integer, but IntegerQ gives False:
Expressions that do not evaluate to integers explicitly will still give False:
It is necessary to use symbolic simplification first:
New in 1 | Last modified in 4