(C++) std::numeric\_limits

January 9, 2018 · View on GitHub

 

 

 

 

 

(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(); }

 

 

 

 

 

 

Contents

  1. 1Example: GetMaxDouble
  2. 2//From http://www.richelbilderbeek.nl/CppGetMaxDouble.htm double GetMaxDouble() { return std::numeric_limits::max(); }"> #include &#x3C;limits> //From http://www.richelbilderbeek.nl/CppGetMaxDouble.htm double GetMaxDouble() { return std::numeric_limits&#x3C;double>::max(); }