My understanding was that doubles are stored based on the IEEE 754-2008 standard in C++, where the first bit is the sign, the following 11 are the exponents and the remaining 52 are the fraction. However, the code below + output shows something else.
Code
#include <bitset>
#include <iostream>
int main() {
double value_float = 1.5;
uint64_t value_uint = 0;
std::memcpy(&value_uint, &value_float, 8);
std::cout << value_uint << std::endl;
std::bitset<64>doubleBitset(value_uint);
std::cout << "DoubleBitset for " << value_float << " is: ";
std::cout << doubleBitset << std::endl;
}
Output: DoubleBitset for 1.5 is: 0011111111111000000000000000000000000000000000000000000000000000
Why isn't the output 0b0 - 00000000001 1000000000000000000000000000000000000000000000000000;