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?
In
help realmin, it says: “REALMIN Smallest positive normalized floating point number.”A normalized floating point number has no leading zeros in the significand – so something like 1.123 * 10^-10. If the significand has leading zeros, like 0.0001 * 10^-10, then it is denormal.
I think
eps(0)gives the smallest denormal number available in Matlab.