1
$\begingroup$

I would like to use a specific precision for several different calculations in Mathematica code. I know that using SetPrecision can give you the required precision for specific calculation. What I would like to know is if there is a way to set the precision at the beginning of the code for all calculations that you have in your code rather than repeating writing the precision command for each individual calculation. In the following example,

prc=20; (* required precision *)
x=5;
y=10;
y1=SetPrecision[x^2 Sin[90],prc]
y2=SetPrecision[Cos[90+y],prc]
y3=SetPrecision[Tan[90-x],prc]

I would like to define or set the precision at the beginning of the code rather than repeating SetPrecision command for each individual calculation y1, y2, and y3 . How this can be done?

$\endgroup$

Browse other questions tagged or ask your own question.