How to subtract two close numbers?

2 次查看(过去 30 天)
Hi!
I've compiled the code below and i don't know why it doesn't give exact zero.
I'll appreciate if someone helps me.
format long
x=5.4;
y=x-5;
z=y-0.4;
disp(z)

采纳的回答

Stephen23
Stephen23 2019-10-16
编辑:Stephen23 2019-10-16

更多回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by