fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. uint64_t order_id = 4631248529308778496;
  6. double order_id_d = *reinterpret_cast<double*>(&order_id);
  7. cout<<order_id<<" "<<order_id_d<<endl;
  8. uint32_t order_id_old = 3;
  9. double order_id_old_d = order_id_old;
  10. uint64_t new_order_id_u = *reinterpret_cast<uint64_t*>(&order_id_old_d);
  11. cout<<new_order_id_u<<" "<<order_id_old_d<<endl;
  12. // your code goes here
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
4631248529308778496 43
4613937818241073152 3