NumericFunction
is an attribute that can be assigned to a symbol f to indicate that f[arg1,arg2,…] should be considered a numeric quantity whenever all the argi are numeric quantities.
Details
- Most standard built‐in mathematical functions have the attribute NumericFunction.
- NumericQ checks the NumericFunction attribute of every function it encounters.
- If you assign the attribute NumericFunction to a function that does not yield numerical values, then NumericQ will give misleading results. »
Examples
open allclose allBasic Examples (1)
Scope (1)
Define f to be a numeric function:
If you have not assigned f to yield numerical values, then NumericQ gives misleading results:
Assign f to evaluate for arguments that are approximate numbers:
Applications (2)
Consider the following two function definitions, where one has the NumericFunction attribute:
Define a function that evaluates faster for numeric input than for arbitrary input:
The evaluation of is faster when it is able to recognize that its argument can be treated as numeric:
Define a function that can represent an exact value:
Assign N[f[a]] to give the derivative with respect to a of the solution of an ODE at :
Assign f for approximate numbers:
f[1] does not evaluate but represents a number:
It will work with any precision (within reasonable limits!):
Properties & Relations (2)
Text
Wolfram Research (1996), NumericFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/NumericFunction.html.
CMS
Wolfram Language. 1996. "NumericFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NumericFunction.html.
APA
Wolfram Language. (1996). NumericFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NumericFunction.html