#include #include typedef union { float f; unsigned u; } bit_float_t; float bit2float(unsigned u) { bit_float_t arg; arg.u = u; return arg.f; } int main(int argc, char *argv[]) { //unsigned test = 0; //unsigned test = 1234567890; int test2 = -1234567890; unsigned test = test2; printf("%u %f %f %d\n", test, bit2float(test), (float)test, (int)test); return 0; }