In C ++, you can use the std::numeric_limits class to get such information.
If has_infinity is true (which will be true for all platforms now), you can use infinitity to get a value that is greater than or equal to all other values โโ(except NaN). Similarly, its negation will give negative infinity and will be less than or equal to all other values โโ(except NaNs again).
If you want to get the final values, you can use min / max (which will be less than or equal to / greater than or equal to all other final values).
Simon byrne
source share