I'm trying to read a binary file made from a c++ program.
This file has some double
numbers and, when I tried to read them, I get a wrong double
value.
This is the HEX value read from the file:
00-67-CC-02-B3-F7-40-CA
Expected value:
0.2051076530529798
Actual value:
-4.9596277989715114E+49
Binary file type: double
8 byte (c++)
Conversion output in c#: double
(binaryreader.ReadDouble()
)
This is the code:
reader = new BinaryReader(File.Open(path, FileMode.Open), Encoding.Default);
double value = reader.ReadDouble();
I already checked, i'm using this command in the right position. Why do I have this different value?