Demo entry 6364642

数值计算方法

   

Submitted by suzui961228 on May 16, 2017 at 17:05
Language: Matlab. Code size: 273 Bytes.

%a machine precision test
clear
epsilon=single(1);
while(single(epsilon+1)>single(1))
    epsilon=single(epsilon/2);
end
epsilon=single(epsilon*2)  %the result of machine precision in this test
eps(single(1))  %the machine precision calculated by built-in function

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).