Is there a standard way to construct a constexpr function that allows conversion of double to it's 64 bit representation:
constexpr uint64_t double_to_uint64_t(double d) {
??????
}
So that
constexpr uint64_t two_bits = double_to_uint64_t(2.0);
would compile?
The reverse method (uint64 to double) is also of interest.
Aucun commentaire:
Enregistrer un commentaire