EvenQ

EvenQ[expr]

gives True if expr is an even integer, and False otherwise.

Details

  • EvenQ[expr] returns False unless expr is manifestly an even integer (i.e. has head Integer, and is even).

Examples

open allclose all

Basic Examples  (2)

Test whether 8 is even:

EvenQ gives False for non-numeric expressions:

Applications  (1)

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:

Wolfram Research (1988), EvenQ, Wolfram Language function, https://reference.wolfram.com/language/ref/EvenQ.html.

Text

Wolfram Research (1988), EvenQ, Wolfram Language function, https://reference.wolfram.com/language/ref/EvenQ.html.

CMS

Wolfram Language. 1988. "EvenQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/EvenQ.html.

APA

Wolfram Language. (1988). EvenQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EvenQ.html

BibTeX

@misc{reference.wolfram_2024_evenq, author="Wolfram Research", title="{EvenQ}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/EvenQ.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_evenq, organization={Wolfram Research}, title={EvenQ}, year={1988}, url={https://reference.wolfram.com/language/ref/EvenQ.html}, note=[Accessed: 22-December-2024 ]}