MATLAB: 0.9-0.89 is 0.010000000000000000208166817117217 faqif statement Hi, why 0.9-0.89 is 0.010000000000000000208166817117217? I want to use it in: if a-b<c sprintf('error') end…… when I use vpa, than I get error in if.. thank you Best Answer One of the most frequently asked questions, so see the FAQ: http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F Related SolutionsMATLAB: Y(0)=0 MATLAB indexing starts at 1.y(1) = 0; MATLAB: What is degeneracy of matrix A=[-1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1]; Hint: doc diag Related QuestionStore 0 as 0.0Dlmwrite 0 to 0.0Is 0<0.010.1+0.2-0.3=Turn 0 to 0.000
Best Answer