fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. double b = 1.123456789e15;
  7.  
  8. cout << (1.0 -1.0/(1.0/b) + 0.1) << endl;
  9. cout << (b + 0.1 - b) << endl;
  10. cout << (b + 0.1 - 1.0/(1.0/b)) << endl;
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
-1.12346e+15
0.125
0