fork(9) download
  1. // numeric_limits example
  2. #include <iostream>
  3. #include <limits>
  4. using namespace std;
  5.  
  6. int main () {
  7. cout << boolalpha;
  8. cout << "Minimum value for double: " << numeric_limits<double>::min() << endl;
  9. cout << "Maximum value for double: " << numeric_limits<double>::max() << endl;
  10. cout << "double is signed: " << numeric_limits<double>::is_signed << endl;
  11. cout << "Non-sign bits in double: " << numeric_limits<double>::digits << endl;
  12. cout << "double has infinity: " << numeric_limits<double>::has_infinity << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
Minimum value for double: 2.22507e-308
Maximum value for double: 1.79769e+308
double is signed: true
Non-sign bits in double: 53
double has infinity: true