fork download
  1. #include <iostream>
  2. #include <limits>
  3. using namespace std;
  4.  
  5. int main() {
  6. cout << (numeric_limits<double>::is_iec559 ? "IEEE 754 encoding":"unknown encoding") <<endl;
  7. cout << (numeric_limits<double>::is_bounded ? "bounded":"not bounded") <<endl;
  8. cout << "Max: "<<numeric_limits<double>::max()<<endl;
  9. cout << "-Max: "<<-numeric_limits<double>::max()<<endl;
  10. cout << "Lowest:" << numeric_limits<double>::lowest()<<endl;
  11. cout << "infinity:" << -1.0/0.0 <<endl;
  12. cout << numeric_limits<double>::has_infinity <<endl;
  13. cout << numeric_limits<double>::traps <<endl;
  14. return 0;
  15. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
IEEE 754 encoding
bounded
Max:   1.79769e+308
-Max:  -1.79769e+308
Lowest:-1.79769e+308
infinity:-inf
1
0