Why does std::numeric_limits<float>::min() give 0.0f instead of -XXX (whatever it is)?

Printable View

- 10-20-2005Magosstd::numeric_limits<float>::min()
Why does std::numeric_limits<float>::min() give 0.0f instead of -XXX (whatever it is)?

- 10-20-2005prog-bman
What compiler? I get 1.17549e-038 with mingw

- 10-20-2005Daved
According to the section in C++ standard about min() (18.2.1.2): "For floating types with denormalization, returns the minimum positive normalized value."

This is probably because floating point numbers are all signed anyway, and knowing the smallest value representable is more useful than knowing the most negative number (which is just the max() * -1).