mercredi 28 septembre 2022

How do I reinterpret a uint64_t variable bits as a double as opposed to static_cast?

uint64 value = 0x543;
double dval = *reinterpret_cast<double*>(&value);

Is there any danger doing this? Do you see a more efficient way of doing this?

Thanks

Aucun commentaire:

Enregistrer un commentaire