Is there a constant in the C++ std lib somewhere that means something like "largest representable number" and "smallest representable number"? In Matlab, we have things like EPS, realmax, and realmin. I was wondering if there was an equivalent for C++.
In the limits header you can find a templatized function for max and min,
std::numeric_limits<TYPE>::max();
std::numeric_limits<TYPE>::min();
Here is some reference: http://www.cplusplus.com/reference/std/limits/numeric_limits/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With