MATLAB Answers


What is the minimum number greater than zero in matlab?

Asked by Venkatraman
on 19 Mar 2013

If I type this: 0.24703282292062327209e-323

I get: 4.9407e-324

If I type this: 0.24703282292062327208e-323

I get: 0

What is the minimum non zero number that matlab uses. It is obviously not realmin = 2.2251e-308 or eps 2.2204e-16.

How can find the true minimum non zero number?



No products are associated with this question.

3 Answers

Answer by James Tursa
on 19 Mar 2013
 Accepted answer

realmin returns the smallest normalized number. To get the smallest denormalized number (not as much precision as a normalized number):


Or for single precision



Thank you. Can you elaborate a little bit about normalized versus denormalized number?

It seems to me that for comparing a>b matlab uses denormalized threshold.

Normalized numbers use the floating point scheme where the exponent varies to keep the first bit of the mantissa a "1" bit, and that "1" bit is not actually stored because it is always implied. As long as the scheme lasts, the number of "useful" bits in the mantissa stays the same as the number gets smaller. Dividing by 2 would result in a decrease in the exponent but no change in the mantissa.

Denormalized numbers use a fixed exponent (one less than for the minimum for normalized numbers) and the leading "1" bit is stored explicitly and will not necessarily be at the beginning of the number. As the leading "1" bit keeps getting further and further right as the numbers go smaller in denormalized numbers, the number of "useful" bits available for the mantissa keeps getting smaller. Dividing by 2 keeps the exponent the same but requires that the mantissa be shifted right (losing the bottom bit.)

Answer by Azzi Abdelmalek
on 19 Mar 2013

 n = realmin


Answer by Walter Roberson
on 19 Mar 2013

>> a = sprintf('%.800g', eps(realmin))
a =

  1 Comment

On PC's the above won't work and you will have to do this:


The NUM2STREXACT function can be found on the FEX here:

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!