Using numeric_limits Template Class to Calculate Type Ranges : numeric_limits « STL Algorithms Helper « C++






Using numeric_limits Template Class to Calculate Type Ranges

  
#include <iostream>
#include <limits>

using namespace std;  

int main(){
     numeric_limits<int> _i;
     cout<<"Integer Range:  "<<_i.min()<<"  "<<_i.max()<<endl;
     return 0;
}
  
    
  








Related examples in the same category

1.Use numeric_limits to get max value for short, int and long
2.Use numeric_limits to get max value for float, double and long double
3.Whether char is signed
4.Whether numeric limits for type string exist