({{, (RefLink[$MachinePrecision, paclet:ref/$MachinePrecision])
gives the number of decimal digits of precision used for machine-precision numbers. }})

OpenersNotesSection(Spacer1)Details

A typical value of (RefLink[$MachinePrecision, paclet:ref/$MachinePrecision]) is 53(RefLink[Log, paclet:ref/Log])[10,2] or approximately 16.

(RefLink[$MachinePrecision, paclet:ref/$MachinePrecision]) is the numerical value of (RefLink[MachinePrecision, paclet:ref/MachinePrecision]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Hardware machine precision used for floating point computation:

$MachinePrecision

OpenersExampleSection1(Spacer1)Scope  (1)

Machine number approximating π:

N[Pi,MachinePrecision]

Arbitrary precision number approximating π with the same precision as machine numbers:

N[Pi,$MachinePrecision]

OpenersExampleSection2(Spacer1)Applications  (1)

Make sure computations are carried out with the same precision as machine numbers:

Block[{$MinPrecision=$MachinePrecision,$MaxPrecision=$MachinePrecision},Exp[1000.]-Exp[1001.]]

Without fixing the precision, the resulting precision may be lower:

Exp[1000.]-Exp[1001.]

OpenersExampleSection3(Spacer1)Properties & Relations  (3)

(RefLink[$MachinePrecision, paclet:ref/$MachinePrecision]) evaluates to a number while (RefLink[MachinePrecision, paclet:ref/MachinePrecision]) is a numerical constant:

{$MachinePrecision,MachinePrecision}

(RefLink[$MachinePrecision, paclet:ref/$MachinePrecision]) is numerically (RefLink[Equal, paclet:ref/Equal]) to (RefLink[MachinePrecision, paclet:ref/MachinePrecision]):

$MachinePrecision==MachinePrecision

(RefLink[$MachinePrecision, paclet:ref/$MachinePrecision]) is the machine precision approximation to (RefLink[MachinePrecision, paclet:ref/MachinePrecision]):

N[{$MachinePrecision,MachinePrecision}]

N[{$MachinePrecision,MachinePrecision},30]

Numbers with just a few digits entered are assumed to have machine precision:

x=1.23456789

Precision is based on the number of digits when more than ⌈$MachinePrecision⌉+1  are entered:

y=1.234567890123456789

{Precision[x],Precision[y]}

(RefLink[$MachinePrecision, paclet:ref/$MachinePrecision]) times the number of bits per digit gives the binary machine precision:

$MachinePrecision*Log[2.,10.]

OpenersExampleSection4(Spacer1)Possible Issues  (1)

(RefLink[$MachinePrecision, paclet:ref/$MachinePrecision]) uses arbitrary precision computations with machine precision resolution:

ode={x''[t]+Sin[x[t]]==0,x[0]==1,x'[0]==0};

asol=NDSolve[ode,x,{t,0,10^3Pi},WorkingPrecision->$MachinePrecision,MaxSteps->Infinity]//Timing

(RefLink[MachinePrecision, paclet:ref/MachinePrecision]) uses machine number computations:

msol=NDSolve[ode,x,{t,0,10^3Pi},WorkingPrecision->MachinePrecision,MaxSteps->Infinity]//Timing

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[MachinePrecision, paclet:ref/MachinePrecision])  ▪  (RefLink[$MachineEpsilon, paclet:ref/$MachineEpsilon])  ▪  (RefLink[$MinMachineNumber, paclet:ref/$MinMachineNumber])  ▪  (RefLink[$MaxMachineNumber, paclet:ref/$MaxMachineNumber])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Numerical Precision, paclet:tutorial/NumericalPrecision])}, {▪(RefLinkPlain[Machine-Precision Numbers, paclet:tutorial/MachinePrecisionNumbers])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[System Information, paclet:guide/SystemInformation])}, {▪(RefLinkPlain[Precision & Accuracy Control, paclet:guide/PrecisionAndAccuracyControl])}, {▪(RefLinkPlain[Representation of Numbers, paclet:guide/RepresentationOfNumbers])}})}})