Use std::numeric_limits<double>::lowest() instead of min().

std::numeric_limits<double>::min() doesn't do what you would expect.