I have an unsigned long long (or uint64_t) value and want to convert it to a double. The double shall have the same bit pattern as the
unsigned long long
uint64_t
double
Beware of union and reinterpret_cast(&bits), for both of these methods are UB. Pretty much all you can do is memcpy.
union
reinterpret_cast(&bits)