Today I stumbled onto this plain problem in Matlab:
>> 1/(10^309)
ans =
0
and everything is fine. Now I type:
>> 0.0001/(10^308)
ans =
9.999999999984653e-313
and get very confused. Wasn't the smallest number possible in Matlab realmin=2.225073858507201e-308
? Why is the above output not giving 0
?
realmin
returns the smallest positive normalized floating-point number in IEEE double precision.
There are smaller positive denormal floating point numbers. Have a look at “What Every Computer Scientist Should Know About Floating-Point Arithmetic”.
You might be more interested in eps
that returns the smallest increment between distinct numbers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With