fork download
  1. #include <iostream>
  2.  
  3. int main() {
  4. double i = 0.1;
  5. double total = 0.0;
  6. for(int j = 0; j < 10000; j++) {
  7. total+=i;
  8. }
  9.  
  10. std::cout << std::boolalpha << "total == 1000.0 ? " << (total == 1000.0) << std::endl;
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
total == 1000.0 ? false