MATLAB: Round-off issue

round-off

I can't figure out why the floor wont come to 1752?
>> 3.501/40*20*10^3+1.5
ans =
1.752000000000000e+003
>> floor(ans)
ans =
1751

Best Answer

Rounding error caused by floating point calculation.
>> 3.501/40*20*10
ans =
17.504999999999995
Related Question