A truly portable C ++ solution
As from C ++ 11 you can use numeric_limits<double>::lowest() . According to the standard, it returns exactly what you are looking for:
The final value of x is such that there is no other final value of y, where y < x .
The value for all specializations in which is_bounded != false .
Demo version
There are many incompatible answers in C ++!
There will be many answers for -std::numeric_limits<double>::max() .
Fortunately, they will work well in most cases. Floating-point coding schemes decompose the number in the mantissa and exponent, and most of them (for example, the popular IEEE-754 ) use a separate character bit that does not belong to the mantissa. This allows you to convert the largest positive value to the smallest negation by simply clicking the sign:

Why are they not tolerated?
The standard does not impose any floating point standard.
I agree that my argument is a little theoretical, but suppose that some eccentric compiler developer would use a revolutionary coding scheme with a mantissa encoded in two versions of two additions . The coding of the two additions is not symmetrical. for example, for a signed 8 bit char, the maximum positive is 127, but the minimum minus is -128. Thus, we could imagine that floating point encoding shows similar asymmetric behavior.
I am not aware of any coding scheme like this, but the fact is that the standard does not guarantee that switching the sign gives the expected result . So this popular answer (sorry guys!) Cannot be considered a fully portable standard solution! / * at least if you are not claiming that numeric_limits<double>::is_iec559 true * /
Christophe Sep 22 '16 at 20:37 2016-09-22 20:37
source share