Imprecise Basic operations
Show older comments
Hi everyone,
I am using Matlab 2009a. When I try to calculate
0.9 - 0.8 - 0.1
then the result is
-2.775557561562891 e-017
Close to zero, but not zero. Is it not possible to get a precise solution for a floating point operation? This minor imprecision has large implications for my programs.
Is there a way to get precise calculations? Why does matlab get this (quite easy task) wrong?
Thanks for your help!
1 Comment
James Tursa
on 13 Jul 2011
You might find this FEX submission useful:
http://www.mathworks.com/matlabcentral/fileexchange/22239-num2strexact-exact-version-of-num2str
Accepted Answer
More Answers (1)
Philipp
on 14 Jul 2011
0 votes
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!