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 >

OddQ

OddQ[expr]
gives True if expr is an odd integer, and False otherwise.
  • OddQ[expr] returns False unless expr is manifestly an odd integer (i.e., has head Integer, and is odd).
Test whether 9 is odd:
OddQ gives False for non-numeric expressions:
Test whether 9 is odd:
In[1]:=
Click for copyable input
Out[1]=
 
OddQ gives False for non-numeric expressions:
In[1]:=
Click for copyable input
Out[1]=
Test whether a vector consists of odd integers:
An integer is either odd or even. Use EvenQ to check that an integer is even:
Odd integers are not divisible by 2:
Expressions that represent odd 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