Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Expressions > Testing Expressions >
Mathematica > Core Language > Procedural Programming > Conditionals > Testing Expressions >

EvenQ

EvenQ[expr]
gives True if expr is an even integer, and False otherwise.
  • EvenQ[expr] returns False unless expr is manifestly an even integer (i.e., has head Integer, and is even).
Test whether 8 is even:
EvenQ gives False for non-numeric expressions:
Test whether 8 is even:
In[1]:=
Click for copyable input
Out[1]=
 
EvenQ gives False for non-numeric expressions:
In[1]:=
Click for copyable input
Out[1]=
Test whether an array consists of even integers:
An integer is either odd or even. Use OddQ to check that an integer is odd:
Even integers are divisible by 2:
The generating function of the even integers is :
Expressions that represent even integers but do not evaluate explicitly will still give False:
It is necessary to use symbolic simplification first:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team