I have this code:
std::string GetBinary32( double value )
{
union
{
float input; // assumes sizeof(float) == sizeof(int)
int output;
} data;
data.input = value;
std::bitset<sizeof(float) * CHAR_BIT> bits(data.output);
std::string mystring = bits.to_string<char, std::char_traits<char>, std::allocator<char> >();
return mystring;
}
I want to get a 64 representation of the double.
what do i need to change?