MATLAB: Rounding in Matlab (very trivial)

rounding

Today is my first day using Matlab. I have been using C++ for last few years. Could someone please explain why FALSE is printed here?
%%Rounding of decimal fractions
x1=0.3
x2=0.1+0.1 + 0.1
test1=(x1==x2) % PRINTS FALSE? WHY?

Best Answer

See question 1 in the Mathematics section of the FAQ.