fork download
  1. #include <iostream>
  2. #include <netinet/in.h>
  3. #include <cstdint>
  4. using namespace std;
  5.  
  6. int main() {
  7. uint64_t val = 4837162400658920070;
  8. double *ord = (double*)(&val);
  9. uint64_t id = static_cast<uint64_t>(*ord);
  10. printf("%lu\n", id);
  11. val = 4837162400658970206;
  12. ord = (double*)(&val);
  13. id = static_cast<uint64_t>(*ord);
  14. printf("%lu\n", id);
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5272KB
stdin
Standard input is empty
stdout
2400000245188931
2400000245213999