matlab 中的eps指什么(eps=2.2204e-016)

来源:百度知道 编辑:UC知道 时间:2024/06/16 14:46:30

Matlab中最小的数-eps

eps=2.2204e-016
Floating-point relative accuracy
Syntax
eps
d = eps(X)
eps('double')
eps('single')

Description

eps returns the distance from 1.0 to the next largest double-precision number, that is eps = 2^(-52).
d = eps(X) is the positive distance from abs(X) to the next larger in magnitude floating point number of the same precision as X. X may be either double precision or single precision. For all X,
eps(X) = eps(-X) = eps(abs(X))

eps('double') is the same as eps or eps(1.0).
eps('single') is the same as eps(single(1.0)) or single(2^-23).
Except for denormals, if 2^E <= abs(X) < 2^(E+1), then
eps(X) = 2^(E-23) if isa(X,'single')
eps(X) = 2^(E-52) if isa(X,'double')

Replace expressions of the form
if Y < eps * ABS(X)

with
if Y < eps(X)

Examp