`clear allclcy=10^-8;z=1;x(1)=y;for i=0:16 for j=1:9 x(z+1)=x(z)+y; z=z+1; end y=y*10;end[~,m]=size(x);u=1;for i=1:m if x(i)==0.01 u=u+1 endend`

# MATLAB: I have this small code. If statement fails to execute when x(i)<=10^0 say for 10^-5, 10^-1 or 10^0 even though matrix x contains the given elements

comparing floating point numbersfaqif statement

## Best Answer