EPS Double Precision Floating Point Relative Machine Precision Epsilon

Section: Base Constants

Usage

Returns eps, which quantifies the relative machine precision of floating point numbers (a machine specific quantity). The syntax for eps is:
   y = eps
   y = eps('double')
   y = eps(X)

First form returns eps for double precision values. For most typical processors, this value is approximately 2^-52, or 2.2204e-16. Second form return eps for class double or single. Third form returns distance to the next value greater than X.

Example

The following example demonstrates the use of the eps function, and one of its numerical consequences.
--> eps

ans = 
 2.2204e-16 

--> 1.0+eps

ans = 
    1.0000 

--> eps(1000.)

ans = 
 1.1369e-13