What happens when numbers get very small?

30 views (last 30 days)
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

Accepted Answer

Iain
Iain on 12 Feb 2014
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).

More Answers (1)

Andreas Goser
Andreas Goser on 12 Feb 2014
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.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!