This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
 Documentation / Mathematica / Built-in Functions / Programming / Tests  /
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).
  • You can use OddQ[ x ] = True to override the normal operation of OddQ, and effectively define x to be an odd integer.
  • See the Mathematica book: Section 2.3.5Section 3.1.1.
  • See also: IntegerQ, EvenQ, TrueQ.

    Further Examples

    This command forces the constant int1 to be odd.

    In[1]:=

    Out[1]=

    In[2]:=

    Out[2]=

    In[3]:=