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).
Examplesopen allclose all
Basic Examples (2)
Test whether 8 is even:
EvenQ gives False for non-numeric expressions:
Test whether an array consists of even integers:
Properties & Relations (3)
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 :
Possible Issues (1)
Expressions that represent even integers but do not evaluate explicitly will still give False:
It is necessary to use symbolic simplification first: