What is the range of datatype double in Matlab ?

41 views (last 30 days)
If we assign any value to a variable , Matlab assigns its data type as double .
What is the max range of that variable ?

Accepted Answer

David Sanchez
David Sanchez on 21 Aug 2013
All numerical variables in MATLAB are stored as 32 bit floating point numbers. This corresponds to double precision on most computers. I think it can range from -1.7976931348623158e+308 to -2.2250738585072014e-308, or from 2.2250738585072014e-308 to 1.7976931348623158e+308.
James Tursa
James Tursa on 21 Aug 2013
Edited: James Tursa on 21 Aug 2013
To clarify the lower range, numbers between these two number ranges are "de-normalized" or "sub-normal", meaning they have less precision (using fewer actual mantissa bits) than a regular double.
>> typecast(uint64(1),'double')
ans =
>> realmin
ans =
Whereas numbers between these two ranges have full precision (use all available mantissa bits):
>> realmin
ans =
>> realmax
ans =
Similar for negative numbers.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by