Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

eps

Floating Point Relative Accuracy


Description

Distance from 1.0 to the next largest double-precision number.

Usage

eps(x = 1.0)

Arguments

x

scalar or numerical vector or matrix.

Details

d=eps(x) is the positive distance from abs(x) to the next larger floating point number in double precision.

If x is an array, eps(x) will return eps(max(abs(x))).

Value

Returns a scalar.

Examples

for (i in -5:5) cat(eps(10^i), "\n")
# 1.694066e-21 
# 1.355253e-20 
# 2.168404e-19 
# 1.734723e-18 
# 1.387779e-17 
# 2.220446e-16 
# 1.776357e-15 
# 1.421085e-14 
# 1.136868e-13 
# 1.818989e-12 
# 1.455192e-11

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.