Skip to content

$MachineEpsilon

Status: Stable

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

Description

$MachineEpsilon
    gives the difference between 1.0 and the next-nearest number
    representable as a machine-precision number.

Equals the platform's DBL_EPSILON; measures the granularity of
machine-precision numbers.

Examples

All examples below are verified against the current Mathilda build.

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}

In[4]:= MachineNumberQ[$MaxNumber]   (* MPFR, not machine *)
Out[4]= False

Implementation notes

A read-only system constant bound as an OwnValue in system_constants_init (src/core.c) via register_system_constant, then marked ATTR_PROTECTED. Its value is expr_new_real(DBL_EPSILON) — the <float.h> machine epsilon of the local IEEE 754 double.

Attributes: Protected.

Implementation status

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

References