Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Expressions > Evaluation Control >

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 x is substituted with a list:
Define a function that represents the real-valued root x^(1/n) for positive x and positive integer n:
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
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team