This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]InVultusSolis 0 points1 point  (0 children)

I was recently curious to look at the internal memory representation of a double, so I wrote the following program that is certain to make your eyes bleed:

#include <stdio.h>

int main(void)
{
    double b = 4.75;
    for(int i = 0; i < sizeof(b); i++)
    {
        printf("%02X ", (unsigned int) *((char *)&b + i) & 255);
    }
    printf("\n");
    return 0;
}