2013
12-04

Floating Point Presentation

Do you know IEEE’s constact of single floating point data? If you are not sure, following is the contract:

This problem is really simple for you: please convert the real data into the IEEE single floating point data presentation.

There are N(1<=N<=150) real data need to be converted. Real data can be negative, zero, and positive.

For each real data, print the IEEE single floating point data presentation in upper case hexadecimal letters in a single line.

2
23.85
-23.85

41BECCCD
C1BECCCD

1. #include <stdio.h>
int main(void)
{
int arr[] = {10,20,30,40,50,60};
int *p=arr;
printf("%d,%d,",*p++,*++p);
printf("%d,%d,%d",*p,*p++,*++p);
return 0;
}

为什么是 20,20,50,40,50. 我觉得的应该是 20,20,40,40,50 . 谁能解释下？