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  /
NumberQ

  • NumberQ[ expr ] gives True if expr is a number, and False otherwise.
  • NumberQ[ expr ] returns False unless expr is manifestly a number (i.e., has head Complex, Integer, Rational or Real).
  • NumberQ[Infinity] gives False.
  • NumberQ[Overflow[ ]] and NumberQ[Underflow[ ]] give True.
  • You can use NumberQ[ x ] = True to override the normal operation of NumberQ, and effectively define x to be a number.
  • See the Mathematica book: Section 2.3.5Section 3.1.1.
  • See also: NumericQ, IntegerQ, TrueQ.

    Further Examples

    In[1]:=

    Out[1]=

    In[2]:=

    Out[2]=

    In[3]:=

    Out[3]=