How I can multiply 2 variables without losing precision
4 次查看(过去 30 天)
显示 更早的评论
a= 378979003;
b= 1.443e-5;
The result of a*b is 5468.7 but I'm very interested in higher precision (such as 5468.6670). How to achieve those precision?
1 个评论
John D'Errico
2014-7-4
The point of both answers is that MATLAB never did "lose" any precision. You did not see those extra digits because of the wrong format for your goals.
采纳的回答
Azzi Abdelmalek
2014-7-4
You can check that a*b and 5468.7 are not equal
a*b==5468.7
Now try this
format long
c=a*b
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!