WOLFRAM

NumericFunction
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

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Log has the NumericFunction attribute:

Out[1]=1

When Log has an argument that is a number, constant, or numeric, the result is numeric:

Out[2]=2

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

Out[3]=3

Scope  (1)Survey of the scope of standard use cases

Define f to be a numeric function:

If you have not assigned f to yield numerical values, then NumericQ gives misleading results:

Out[2]=2
Out[3]=3

Assign f to evaluate for arguments that are approximate numbers:

Out[5]=5

Applications  (2)Sample problems that can be solved with this function

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:

Out[6]=6
Out[7]=7

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:

Out[4]=4
Out[5]=5

It will work with any precision (within reasonable limits!):

Out[6]=6

A plot of the function:

Out[7]=7

Properties & Relations  (2)Properties of the function, and connections to other functions

Sin has the attribute NumericFunction:

Out[1]=1

The NumericFunction attribute informs NumericQ that Sin[1] can be converted into a number when using N:

Out[2]=2

NumericQ can return True without having to evaluate N[Sin[1]]:

Out[3]=3

Note that NumberQ returns False:

Out[4]=4

Some of the system symbols that are numeric functions:

Out[1]=1
Wolfram Research (1996), NumericFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/NumericFunction.html.
Wolfram Research (1996), NumericFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/NumericFunction.html.

Text

Wolfram Research (1996), NumericFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/NumericFunction.html.

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.

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

Wolfram Language. (1996). NumericFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NumericFunction.html

BibTeX

@misc{reference.wolfram_2025_numericfunction, author="Wolfram Research", title="{NumericFunction}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/NumericFunction.html}", note=[Accessed: 14-March-2025 ]}

@misc{reference.wolfram_2025_numericfunction, author="Wolfram Research", title="{NumericFunction}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/NumericFunction.html}", note=[Accessed: 14-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_numericfunction, organization={Wolfram Research}, title={NumericFunction}, year={1996}, url={https://reference.wolfram.com/language/ref/NumericFunction.html}, note=[Accessed: 14-March-2025 ]}

@online{reference.wolfram_2025_numericfunction, organization={Wolfram Research}, title={NumericFunction}, year={1996}, url={https://reference.wolfram.com/language/ref/NumericFunction.html}, note=[Accessed: 14-March-2025 ]}