Skip to content

$MachinePrecision

Status: Stable

documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

Description

$MachinePrecision

gives the number of decimal digits of precision used for machine-precision numbers.

Notes Derived from the platform's DBL\_MANT\_DIG -- typically 53\*Log\[10,2\] (~ 15.9546) on IEEE 754 systems.

Examples (4)

Every input below was run against the current Mathilda build and its output recorded.

Basic examples (4)

In[1]:= $MachinePrecision
Out[1]= 15.9546

In[2]:= $MachineEpsilon
Out[2]= 2.22045e-16

In[3]:= {$MinMachineNumber, $MaxMachineNumber}
Out[3]= {2.22507e-308, 1.79769e+308}

MPFR, not machine

In[4]:= MachineNumberQ[$MaxNumber]
Out[4]= False

Implementation notes

A Protected OwnValue registered in system_constants_init (src/core.c) as expr_new_real(NUMERIC_MACHINE_PRECISION_DIGITS) — the number of decimal digits in a machine double (~15.95).

Attributes: Protected.

References

See also: $MachineEpsilon, $MinMachineNumber, $MaxMachineNumber, $MaxNumber, $MinNumber