Is DBL_MIN the smallest positive double?

Q: Is DBL_MIN the least positive double?

Below is the code referenced by this question. But if so, how is DBL_MIN defined and what is its use or purpose.

Platform: Windows7 and Visual Studio 2013

double next_to_zero = std::nextafter(0.0,DBL_MIN);
bool b =  DBL_MIN <= next_to_zero;
std::cout << std::boolalpha 
          << "is dbl_min the smallest representable double? "
          << b << '\n';

std::cout << std::setprecision(56)
          << "dbl_min = " << DBL_MIN << '\n'
          << "next to zero = " << next_to_zero;

outputs:

is dbl_min the smallest representable double? Lying

dbl_min = 2.2250738585072013830902327173324040642192159804623318306e-308

near zero = 4.9406564584124654417656879286822137236505980261432476443e-324

+4
source share
1 answer

I limit this answer, perhaps unnecessarily, to the IEEE754 floating point.

DBL_MIN cannot be a subnormal number.

std::nextafter .

, DBL_MIN.

. https://en.wikipedia.org/wiki/Denormal_number

+7

Source: https://habr.com/ru/post/1656081/


All Articles