NHoldAll
Details

- NHoldAll, NHoldFirst, and NHoldRest are useful in ensuring that arguments to functions are maintained as exact integers, rather than being converted by N to approximate numbers.
Examples
open all close allBasic Examples (1)
Prevent N from affecting the arguments of a function:
Scope (3)
System symbols with the NHoldAll attribute:
The arguments of Derivative remain unchanged with N:
N leaves the derivative order while changing the point of evaluation:
The function with coefficients converted to numerical values:
The positional parameters remain unchanged with N because Slot has the NHoldAll attribute:
Applications (2)
With this attribute, the variables remain unchanged:
Define a data object that represents a polynomial in a sparse form
:
Make sure that N only affects the coefficients, not the powers:
Default N evaluation of the argument needs to be prevented for the rule above to work:
A representation of the polynomial :
See Also
Tech Notes
Related Guides
History
Introduced in 1996 (3.0)
Text
Wolfram Research (1996), NHoldAll, Wolfram Language function, https://reference.wolfram.com/language/ref/NHoldAll.html.
CMS
Wolfram Language. 1996. "NHoldAll." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NHoldAll.html.
APA
Wolfram Language. (1996). NHoldAll. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NHoldAll.html
BibTeX
@misc{reference.wolfram_2025_nholdall, author="Wolfram Research", title="{NHoldAll}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/NHoldAll.html}", note=[Accessed: 13-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_nholdall, organization={Wolfram Research}, title={NHoldAll}, year={1996}, url={https://reference.wolfram.com/language/ref/NHoldAll.html}, note=[Accessed: 13-August-2025]}