Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) std::numeric_limits

 

std::numeric_limits is an STL template function to obtain numerical limits from numerical data types.

 

 

 

Example: GetMaxDouble

 

GetMaxDouble is a check code snippet to get the maximal value of a double.

 

#include <limits>

//From http://www.richelbilderbeek.nl/CppGetMaxDouble.htm
double GetMaxDouble()
{
  return std::numeric_limits<double>::max();
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict