Home > Back-end >  MATLAB numeric precision when generating a numeric sequence
MATLAB numeric precision when generating a numeric sequence

Time:07-13

I was testing a operation like this:

[input] 3.9/0.1 : 4.1/0.1
[output] 39    40

don't know why 4.1/0.1 is approximated to 40. If I add a round(), it will goes as expected:

[input] 3.9/0.1 : round(4.1/0.1)
[output] 39    40   41

What's wrong with the first operation?

CodePudding user response:

In enter image description here

  • Related