MATLAB: Floor(0.2835*10000) = 2834 WHY??

floor

floor(0.2835*10000) = 2834 WHY???

Best Answer

Because actually, 0.2835*10000 is never exactly 2835, it is 2834.9.... This happens due to the usage of IEEE 754 double precision standard. Since floor means rounding toward negative infinity, the result is 2834.
Edit: answer is edited after Guillaume's comment.