NValues
[symbol]Note: this function is in Mathematica 5 but has been removed from current Mathematica.
NValues[a]
N[a] = 3;
NValues[a]
You can assign values to NValues
:
NValues[b] := {N[b, MachinePrecision] :> 2}
N[b]
Be sure to use SetDelayed
, otherwise the left-hand side of the transformation rule will be evaluated immediately, causing the head of N
to get lost. Furthermore, you have to include the precision in the rules; MachinePrecision
will not be inserted automatically:
NValues[c] := {N[c] :> 3}
N[c]
Mathics will assign any list of rules to NValues
; however, inappropriate rules will never be used:
NValues[d] = {foo -> bar};
NValues[d]
N[d]