NumericQ

NumericQ[expr]

gives True if expr is a numeric quantity, and False otherwise.

Details

  • An expression is considered a numeric quantity if it is either an explicit number or a mathematical constant such as Pi, or is a function that has attribute NumericFunction and all of whose arguments are numeric quantities.
  • In most cases, NumericQ[expr] gives True whenever N[expr] would yield an explicit number.

Examples

open allclose all

Basic Examples  (1)

NumericQ tests whether an object is a numeric quantity:

In[1]:=
Click for copyable input
Out[1]=

In most cases, NumericQ[expr] gives True whenever N[expr] yields an explicit number:

In[2]:=
Click for copyable input
Out[2]=

Scope  (3)

Applications  (3)

Possible Issues  (1)

See Also

NumberQ  NumericFunction

Tutorials

Introduced in 1996
(3.0)