clc,clearnum=0;EPS=1;while(1 + EPS)>1 EPS = EPS/2; num = num + 1;endnum,EPS
运行结果
num = 53EPS = 1.1102e-16
程序在num=53
时停止,EPS
最终结果为1.1102e-16
,说明机器零阈值为2.2204e-16
eps
(浮点数的相对精确度),与之对比是一样的 >> epsans = 2.2204e-16
本文共 284 字,大约阅读时间需要 1 分钟。
clc,clearnum=0;EPS=1;while(1 + EPS)>1 EPS = EPS/2; num = num + 1;endnum,EPS
运行结果
num = 53EPS = 1.1102e-16
程序在num=53
时停止,EPS
最终结果为1.1102e-16
,说明机器零阈值为2.2204e-16
eps
(浮点数的相对精确度),与之对比是一样的 >> epsans = 2.2204e-16
转载于:https://www.cnblogs.com/Genesis2018/p/9079781.html