fork(1) 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. unsigned a=(*(unsigned*)&f),b=a>>16;
  13. printf("%f 0x%08X 0x%04X %f\n",f,a,b,0.5*b-8448);
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
280.000000
65.000000 0x42820000 0x4282 65.000000
65.500000 0x42830000 0x4283 65.500000
66.000000 0x42840000 0x4284 66.000000
66.500000 0x42850000 0x4285 66.500000
67.000000 0x42860000 0x4286 67.000000
67.500000 0x42870000 0x4287 67.500000
68.000000 0x42880000 0x4288 68.000000
68.500000 0x42890000 0x4289 68.500000
69.000000 0x428A0000 0x428A 69.000000
69.500000 0x428B0000 0x428B 69.500000
70.000000 0x428C0000 0x428C 70.000000
70.500000 0x428D0000 0x428D 70.500000
71.000000 0x428E0000 0x428E 71.000000
71.500000 0x428F0000 0x428F 71.500000
72.000000 0x42900000 0x4290 72.000000
72.500000 0x42910000 0x4291 72.500000
73.000000 0x42920000 0x4292 73.000000
73.500000 0x42930000 0x4293 73.500000
74.000000 0x42940000 0x4294 74.000000
74.500000 0x42950000 0x4295 74.500000
75.000000 0x42960000 0x4296 75.000000
75.500000 0x42970000 0x4297 75.500000
76.000000 0x42980000 0x4298 76.000000
76.500000 0x42990000 0x4299 76.500000
77.000000 0x429A0000 0x429A 77.000000
77.500000 0x429B0000 0x429B 77.500000
78.000000 0x429C0000 0x429C 78.000000
78.500000 0x429D0000 0x429D 78.500000
79.000000 0x429E0000 0x429E 79.000000
79.500000 0x429F0000 0x429F 79.500000
80.000000 0x42A00000 0x42A0 80.000000