fork download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main() {
  6. volatile double a = 1.523e32;
  7. volatile double b = 0.00000512345;
  8. volatile double c = 1243423.43432e-17;
  9. volatile double abc = 0.0;
  10. abc += a;
  11. abc += b;
  12. abc += c;
  13. volatile double bac = 0.0;
  14. bac += b;
  15. bac += a;
  16. bac += c;
  17. std::cout << memcmp((void*)&abc, (void*)&bac, sizeof(double));
  18. return 0;
  19. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Standard output is empty