I was trying to tutor MATLAB to one of the underclassman I tutor. I came across an error that I initially could not fix. I eventually found the error but it isn't my error. MATLAB calculated the wrong number! -2.9982*5=-14.991 not -2.9982*5=-14.991000000000001. I can avoid using this calculation in the code but I just want to know what is causing this silly error so I can avoid it again.
MATLAB: Is MATLAB messing up this very simple calculation.
floating point error.floating point numbernot a bugright valuewrong value
Related Question
- Numerical Multiplication in MATLAB
- How to round up all components of a matrix to nearest ‘k’ decimal
- Will round() not work on this number for 4 decimal places
- How to get rid of exponent notation from a variable output
- Floor(0.2835*10000) = 2834 WHY??
- Matlab floating point precision.
- 0.35 divide 0.001 return double, and 0.34 divide 0.001 return int.
Best Answer