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

SetAccuracy

SetAccuracy[expr, a]
yields a version of expr in which all numbers have been set to have accuracy a.
  • When SetAccuracy is used to increase the accuracy of a number, the number is padded with zeros. The zeros are taken to be in base 2. In base 10, the additional digits are usually not zeros.
  • When expr contains machine-precision numbers, SetAccuracy[expr, a] can give results which differ from one computer system to another.
  • SetAccuracy will first expose any hidden extra digits in the internal binary representation of a number, and only after these are exhausted add trailing zeros.  »
  • 0.004``25 generates a number with all trailing digits zero and accuracy 25 on any computer system.
Set the accuracy of all numbers in an expression to 20:
In[1]:=
Click for copyable input
Out[1]=
 
Convert from a machine number to an arbitrary-precision number with accuracy 32:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
New in 2