This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

NHoldRest

NHoldRest
is an attribute which specifies that all but the first argument to a function should not be affected by N.
Prevent N from affecting all but the first argument of a function:
Prevent N from affecting all but the first argument of a function:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
System symbols with the NHoldRest attribute:
Use Part symbolically:
Using N does not affect the specified parts:
The expression works when is substituted with a list:
Define a function that represents the real-valued root for positive and positive integer :
Prevent its second argument from being converted to real using NHoldRest:
An exact representation of the cube root of 2:
Machine-number approximation:
47-digit approximation:
Subscript by default has the NHoldRest attribute:
This means that subscripts generally do not change under N:
HoldRest prevents evaluation while NHoldRest only prevents numerical evaluation:
You can prevent both by setting both attributes:
New in 3