The numerical value for the precision in mathematica is given out by $MachinePrecision, and this is also the number of relevant digits showed in the output console when performing a computation with floating points.
Howewer, by executing for example RealDigits[Pi, 10, 300] I can see 3 hundrends decimals, each of them correct. Moreover even the multiplication RealDigits[Pi*3, 10, 300] is perfectly correct on any of the decimal, and it is not just approximated on the first $MachinePrecision ones.
I am wondering why this is possible, what is actually the real grade of precision when doing arithmetic operation on Mathematical. My vision is not clear right now. Thank you.
$MachinePrecisionis the precision of machine numbers. You get a machine number when you e.g. enter it as3.5234instead of e.g.35234/10000. Also, default precision forNis$MachinePrecision, so e.g.N[3]will give you a machine representation of 3.When you enter
Pior3Pi, you get an exact number. It's a symbolic representation of a number, which can be evaluated to arbitrary precision usingN. Similarly, you getSqrt[5]if you evaluate e.g.25^(1/4), while evaluation of25.0^(1/4)will give you machine-precision approximation2.23606797749979. So you'll get:To avoid confusion, note that
FullFormshows more digits than the number precision actually is. They are the internal detail of implementation of the number storage and are printed for user to be able to save and then restore the exact same value as current session has. To see the numbers in their actual precision, omit the call toFullForm:To see your example in the context of machine precision, try evaluating
RealDigits[Pi*3., 10, 300]instead ofRealDigits[Pi*3, 10, 300](note the difference:3.vs3). Also try the arbitrary-precision version:RealDigits[Pi*3.0`11, 10, 300](or replace11with your desired precision of the input number).