S
scosmo
Hello,
I've this "little" problem , I hope someone could help me.
I'm using g++ on a linux machine.
I'm reading, from a binary file, the following sequence of data:
3e 41 89 37
through the following instructions:
double y;
fread(&y,8,1,file);
the 8 bytes read represents a 8 byte real floating number expressed in
the following representation:
SEEEEEEE MMMMMMMM MMMMMMMM …. MMMMMMMM
Where S is the sign, E the exponent and M the mantissa.
I do not know if g++ represents double data in the same way... this is
the real problem.
The question is: how could I convert the read data into a double
variable?
I should obtain a double value of 0.001 from this data.
Regards,
camelot
I've this "little" problem , I hope someone could help me.
I'm using g++ on a linux machine.
I'm reading, from a binary file, the following sequence of data:
3e 41 89 37
through the following instructions:
double y;
fread(&y,8,1,file);
the 8 bytes read represents a 8 byte real floating number expressed in
the following representation:
SEEEEEEE MMMMMMMM MMMMMMMM …. MMMMMMMM
Where S is the sign, E the exponent and M the mantissa.
I do not know if g++ represents double data in the same way... this is
the real problem.
The question is: how could I convert the read data into a double
variable?
I should obtain a double value of 0.001 from this data.
Regards,
camelot