[ create a new paste ] login | about

Link: http://codepad.org/F96COWCM    [ raw code | output | fork ]

C, pasted on Mar 22:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>

int main()
{
    int i, j, k;
    union u 
    {
        float a;
        int b;
    } f;
    f.a = 121.3;
    for(i = 31; i >= 0; --i)
    {
       printf("%d", ((f.b >> i) & 0x1) );
    }
    scanf("%d");
    return 0;
}


Output:
1
01000010111100101001100110011010


Create a new paste based on this one


Comments: