I have a problem with matlab and i'm almost sure I've seen it before somewhere and gone around it, but now I want to solve it... When I'm doing a simple calculation:
>> 14336*0.005
You'll get the expected answer:
ans = 71.6800
but when using format long:
format long; ans = 71.680000000000007
It doesn't seem to be a problem for matlab:
ans==71.68 = 1
But if I do one more calculation:
ans/0.005 = 1.433600000000000e+04
ans==14336 = 0
ans-14336 = 1.818989403545856e-12
Do anyone know a solution to get rid of the difference of 1.81e-12 of the original value and final value? I guess it's due to datatypes and stuff but is there a solution?
//Lucas