Defining Numerical Values

If you make a definition such as f[x_]:=value, the Wolfram Language will use the value you give for any f function it encounters. In some cases, however, you may want to define a value that is to be used specifically when you ask for numerical values.

 expr=value define a value to be used whenever possible N[expr]=value define a value to be used for numerical approximation

Defining ordinary and numerical values.

This defines a numerical value for the function f:
 In:= Defining the numerical value does not tell the Wolfram Language anything about the ordinary value of f:
 In:= Out= If you ask for a numerical approximation, however, the Wolfram Language uses the numerical values you have defined:
 In:= Out= You can define numerical values for both functions and symbols. The numerical values are used by all numerical Wolfram Language functions, including NIntegrate, FindRoot, and so on.

 N[expr]=value define a numerical value to be used when default numerical precision is requested N[expr,{n,Infinity}]=value define a numerical value to be used when n‐digit precision and any accuracy is requested

Defining numerical values that depend on numerical precision.

This defines a numerical value for the symbol const, using 4n+5 terms in the product for ndigit precision:
 In:= Here is the value of const, computed to 30digit precision using the value you specified:
 In:= Out= The Wolfram Language treats numerical values essentially like upvalues. When you define a numerical value for f, the Wolfram Language effectively enters your definition as an upvalue for f with respect to the numerical evaluation operation N.