how to get correct value on division in matlab
2 次查看(过去 30 天)
显示 更早的评论
I am dividing 60 by 88.8888888888889 in matlab. It is giving result as 0.675000000000000. But when I am doing the same calculation on a calculator, the result is 0.674999999999999.
How to get 0.674999999999999 as result using matlab. Please help.
0 个评论
回答(2 个)
dpb
2016-4-13
>> 60/88.8888888888889-4*eps(ans)
ans =
0.674999999999999
>>
Can't expect FP precision to be the same between Matlab and another computing platform; there can be differences even with the same computation of different computers owing to word sizes and implementation.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!