fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. volatile double x=120;
  5.  
  6. int main() {
  7. double a = x*(1/10.0);
  8. double b = x/10.0;
  9.  
  10. if(a != b) cout<<"nie jest to dobry sposób"<<endl;
  11.  
  12. for(unsigned i = 0; i < sizeof(double); ++i)
  13. cout<<(int)((char*)&a)[i];
  14. cout<<endl;
  15. for(unsigned i = 0; i < sizeof(double); ++i)
  16. cout<<(int)((char*)&b)[i];
  17. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
nie jest to dobry sposób
0000004064
0000004064