OddQ

OddQ[expr]

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

Details

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

Examples

open allclose all

Basic Examples  (2)

Test whether 9 is odd:

OddQ gives False for non-numeric expressions:

Applications  (1)

Test whether a vector consists of odd integers:

Properties & Relations  (2)

An integer is either odd or even. Use EvenQ to check that an integer is even:

Odd integers are not divisible by 2:

Possible Issues  (1)

Expressions that represent odd integers but do not evaluate explicitly will still give False:

It is necessary to use symbolic simplification first:

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

Text

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

BibTeX

@misc{reference.wolfram_2020_oddq, author="Wolfram Research", title="{OddQ}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/OddQ.html}", note=[Accessed: 01-March-2021 ]}

BibLaTeX

@online{reference.wolfram_2020_oddq, organization={Wolfram Research}, title={OddQ}, year={1988}, url={https://reference.wolfram.com/language/ref/OddQ.html}, note=[Accessed: 01-March-2021 ]}

CMS

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

APA

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