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 >

NumberQ

NumberQ[expr]
gives True if expr is a number, and False otherwise.
NumberQ tests whether an object is explicitly a number:
The expression must be manifestly a number:
You can test if a quantity represents a number with NumericQ:
On numerical coercion with N such quantities generally become numbers:
The same is true for complex and directed infinities:
They are both treated as Real:
Test if a matrix consists entirely of numbers:
Define a function that only evaluates when the argument is a number:
It does not evaluate with a symbolic argument:
It does evaluate when the argument is a number:
Use FindRoot to find all the solutions of the boundary value problem with x(0)=x(10)=0:
Plot the solutions:
NumberQ is equivalent to MatchQ[#, _Integer|_Rational|_Real|_Complex]&:
If NumberQ[x] is True, then NumericQ[x] is also True:
New in 1 | Last modified in 3
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team