I am trying to interpret a binary file and unless I put the bits in the rught position and read it as a float, the numbers mean nothing. I know what order they should go in but I don't know what eah number is, so dividing by anything won't work.
Her's the code I have so far, but the convertion from tempValue to Value doesn't work at all. It spits out an incorrect int, loosing all the decimal places.
Thanks for the replies so far.
# include <stdio.h>
# define BYTE21 0X0000ffff
# define BYTE43 0Xffff0000
long new21, new43;
inp = fopen("test_outp.baf", "rb");
printf("The file could not be opened.\n");
new21 = (TempValue & BYTE21) << 16;
new43 = (TempValue & BYTE43) >> 16;
TempValue = new21 | new43;
Value = TempValue;
printf("%f \n", Value);