I have a IEEE754 Double precision 64-bit binary string representation of a double number.
example : double value = 0.999;
Its binary representation is “0011111111101111111101111100111011011001000101101000011100101011”
I want to convert this string back to a double number in c++.
I dont want to use any external libraries or .dll’s as my program would operate in any platform.
C string solution:
std::stringsolution:generic solution:
example calls:
Note: I assume
unsigned long longhas 64 bits. A cleaner solution would be to include<cstdint>and useuint64_tinstead, assuming your compiler is up to date and provides that C++11 header.