fork download
  1. #include <iostream>
  2.  
  3. int main(void)
  4. {
  5. float const step = 1e-15;
  6. float const init = 1;
  7. long int const count = 1000000000;
  8.  
  9. float result1 = init;
  10. for( int i = 0; i < count; ++i ) result1 += step;
  11.  
  12. float result2 = init;
  13. result2 += step * count;
  14.  
  15. std::cout << (result1 - result2);
  16. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
-9.53674e-07