fork download
  1. #include <stdio.h>
  2. #include <inttypes.h>
  3.  
  4. main(){
  5. uint64_t a = 0xffffffffffffffffULL;
  6. float b;
  7. uint64_t c = 0;
  8.  
  9. printf("sizeof(a)=%d sizeof(b)=%d\n", sizeof(a), sizeof(b)); //8, 4
  10.  
  11. printf("%llu\n", a); //=>18446744073709551615
  12. b = (float)a;
  13. printf("%f\n", b); //=>18446744073709551616.000000
  14. c = (uint64_t)b;
  15. printf("%llu\n", c); //=>18446744073709551615
  16. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
sizeof(a)=8 sizeof(b)=4
18446744073709551615
18446744073709551616.000000
18446744073709551615