This is a weirdity inherited by C++ from C.
If you want the largest negative number supported by double rather
than the smallest positive number, use
std::numeric_limits<double>::lowest(), available since C++11. With
C++-98/03 you had to use -std::numeric_limits<double>::max() to obtain
that value, which would work with IEEE 754 floating points (ie, those
supplied by the C++ standard) but not necessarily for others.
With integer types, std::numeric_limits::min() gives the same value as
std::numeric_limits::lowest().