eps

The spacing between two adjacent numbers in a given machine's floating point system, Epsilon.

Syntax

R = eps returns a scalar.

R = eps(x) returns a scalar.

R = eps(n, m) returns an m by n matrix.

R = eps(d1, d2, ... dN) returns an N dimensional matrix.

Inputs

x
Any valid scalar | vector | matrix.
Type: double | integer | logical | struct | cell
Dimension: scalar | vector | matrix
n, m, d1, d2
Dimensions of matrix to be returned.
Type: integer
Dimension: scalar

Outputs

R
The returned values.

Examples

Basic eps example:

R = eps()
R = 2.22045e-016

Scalar eps example:

R = eps(4)
R = 8.88178e-016
R = eps(3, 2)
R = [Matrix] 3 x 2
2.22045e-16  2.22045e-16
2.22045e-16  2.22045e-16
2.22045e-16  2.22045e-16