MATLAB: I am facing a very trivial issue: The below equality does’t work for some reason:

floating pointweird issue

x=0.008+0.005 if x==0.0130 disp('hurray'); end

Best Answer

Take a look at this question/answer that is one of many that explains why this seeming error is a consequence of working with floating point precision.