Hello,
I just ran into this weird situation. I am just genuinely curious to know why Matlab behaves this way. Let's say that I have the following variables set in Matlab:
a = 0.9000b = 1.1000c = 1.2000
If I multiply the variables above by 100 I get the following results:
>> a * 100ans = 90>> b * 100ans = 110.0000>> c * 100ans = 120
When multiplying a number by 1.1000 always yields four decimal places. I had a script running into error due to these decimal places – I had to use round() to get rid of the zeros.
Why is it that 1.1000 is the only thing returning multiplication with decimal places while other numbers such as 0.9000 and 1.2000 do not?
Best Answer