fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. unsigned value=0x438C;
  7. float f;
  8. value<<=16;
  9. printf("%f\n",*(float*)&value);
  10. for(f=65;f<=80;f+=0.5)
  11. {
  12. printf("%.1f 0x%08X 0x%04X\n",f,(*(unsigned*)&f),(*(unsigned*)&f)>>16);
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 2052KB
stdin
Standard input is empty
stdout
280.000000
65.0 0x42820000 0x4282
65.5 0x42830000 0x4283
66.0 0x42840000 0x4284
66.5 0x42850000 0x4285
67.0 0x42860000 0x4286
67.5 0x42870000 0x4287
68.0 0x42880000 0x4288
68.5 0x42890000 0x4289
69.0 0x428A0000 0x428A
69.5 0x428B0000 0x428B
70.0 0x428C0000 0x428C
70.5 0x428D0000 0x428D
71.0 0x428E0000 0x428E
71.5 0x428F0000 0x428F
72.0 0x42900000 0x4290
72.5 0x42910000 0x4291
73.0 0x42920000 0x4292
73.5 0x42930000 0x4293
74.0 0x42940000 0x4294
74.5 0x42950000 0x4295
75.0 0x42960000 0x4296
75.5 0x42970000 0x4297
76.0 0x42980000 0x4298
76.5 0x42990000 0x4299
77.0 0x429A0000 0x429A
77.5 0x429B0000 0x429B
78.0 0x429C0000 0x429C
78.5 0x429D0000 0x429D
79.0 0x429E0000 0x429E
79.5 0x429F0000 0x429F
80.0 0x42A00000 0x42A0