NumericQ
Usage
• NumericQ[expr]用来判断expr是否是数值,若是则返回True,否则返回False.
Notes
• 一个表达式被看作一个数值,它要么是一个显式的数,或一个像Pi一样的数学常数,要么是一个具有NumericFunction属性且所有参数均为数值的函数. • 多数情况下,只要N[expr]得到一个明确的数,NumericQ[expr]就返回True.
Further Examples
In[1]:=
|
Out[1]=
|
In[2]:=
|
Out[2]=
|
In[3]:=
|
Out[3]=
|
Because Pi and E are numeric, you can operate with them much as you can with other numbers.
In[4]:=
|
Out[4]=
|
In[5]:=
|
Out[5]=
|
|