What happens when numbers get very small?
14 次查看(过去 30 天)
显示 更早的评论
Hi
My computation works with very small physical quantities. I have numbers in the order of 10^-14 which will be multiplied with numbers in about the order of 10^3 to 10^-8. Typing "eps" on the console results in something around 10^-16.
Does Matlab automatically adjust precision to handle these extremely small numbers? Do I have to worry about quantization errors when numbers get small? What about performance issues?
(Basically, I could also change the units of physical constants to bigger values, but I'd like to avoid this.)
Best regards, Michael
0 个评论
采纳的回答
Iain
2014-2-12
Matlab simply uses standard double format numbers.
This gives you about 15 significant figures of precision from 10^-300 to 10^300 -ish.
When multiplying "a * b" you're likely to get quantisation errors in the order of: eps(a*b), eps(a) * b or eps(b)*a.
You should worry about these quantisations errors when you add large numbers of small values to bigger values (like the obvious way to numerically integrate).
0 个评论
更多回答(1 个)
Andreas Goser
2014-2-12
In most applications I am aware of, one simply uses scaling like multiplying each datapoint by 1e12 etc. In my experience very small numbers are not a problem per se - only in situations where there very different order of magnitudes in ONE matrix or there are operation with data with very different order of magnitudes.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!