Matlab中的 eps是什么意思?
答案:2 悬赏:40 手机版
解决时间 2021-02-04 06:58
- 提问者网友:我一贱你就笑
- 2021-02-03 08:39
求大神通俗的解释一下!有例子更好!help里的解释我花了很长时间也没看太明白!
最佳答案
- 五星知识达人网友:独钓一江月
- 2021-02-03 09:07
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) Examples double precision eps(1/2) = 2^(-53) eps(1) = 2^(-52) eps(2) = 2^(-51) eps(realmax) = 2^971 eps(0) = 2^(-1074) if(abs(x)) <= realmin, eps(x) = 2^(-1074) eps(Inf) = NaN eps(NaN) = NaN single precision eps(single(1/2)) = 2^(-24) eps(single(1)) = 2^(-23) eps(single(2)) = 2^(-22) eps(realmax('single')) = 2^104 eps(single(0)) = 2^(-149) if(abs(x)) <= realmin('single'), eps(x) = 2^(-149) eps(single(Inf)) = single(NaN) eps(single(NaN)) = single(NaN) See Also realmax, realmin eomday eq ? 1994-2005 The MathWorks, Inc. ? Terms of Use ? Patents ? Trademarks%D%A
全部回答
- 1楼网友:西岸风
- 2021-02-03 09:51
我想你可能指的是函数eps(源于epsilon,这个希腊字母在数学上通常表示“无穷小”)。一般来说,计算机的浮点数计算都是不精确的,而误差值随着数据类型以及数值大小而变化。
eps(x)给出了相同数据类型下,比x大的“下一个值”。例如 eps(1.0) 为2^(-52),约2.22*10^(-16)。换句话说,在双精度下,使用matlab获得一个介于1.0和1.0+2^(-52)之间的数是不可能的。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯