minimum double value in C/C++
Floating point numbers (IEEE 754) are symmetrical, so if you can represent the greatest value (DBL_MAX
or numeric_limits<double>::max()
), just prepend a minus sign.
And then is the cool way:
double f;(*((long long*)&f))= ~(1LL<<52);