Prev: Image Data Ouput
Next: Image Processing
From: James Tursa on 9 Mar 2010 03:36 "Zachary " <zpardos(a)so.npam.yahoo.com> wrote in message <hn50h8$1jp$1(a)fred.mathworks.com>... > "James Tursa" <aclassyguy_with_a_k_not_a_c(a)hotmail.com> wrote in message <hn500b$qg8$1(a)fred.mathworks.com>... > > > > >> num2strexact(0.1733) > > ans = > > 0.1733000000000000095923269327613525092601776123046875 > > >> num2strexact(0.0067) > > ans = > > 6.700000000000000226207941267375645111314952373504638671875e-3 > > >> num2strexact(0.1733+0.0067) > > ans = > > 0.1800000000000000210942374678779742680490016937255859375 > > >> num2strexact(0.1800) > > ans = > > 0.179999999999999993338661852249060757458209991455078125 > > > > Using this utility: > > > > http://www.mathworks.com/matlabcentral/fileexchange/22239-num2strexact-exact-version-of-num2str > > > > James Tursa > > Thanks James Also note that the two values differ only in the last bit: >> format hex >> 0.1733+0.0067 ans = 3fc70a3d70a3d70b >> 0.1800 ans = 3fc70a3d70a3d70a James Tursa |