ieee754.h

Functions

static constexpr bool target_is_little_endian()

Test target machine native little-endianness.

static inline uint64_t type_pun_double_to_uint64_t(double d)
static inline double type_pun_uint64_t_to_double(uint64_t num)
static inline bool sign_of_double(double d)
static inline int exp_of_double(double d)

Return the biased exponent of a double in a int64_t. Return value range: [0, 2048)

static inline uint64_t man_of_double(double d)

Return significand/mantissa of a double (without the hidden one) in a uint64_t. Range of returned value: [0, 4503599627370496)

static inline void set_sign_of_double(double &d, bool sign)

[Un]set the sign of a double type from a bool

static inline void set_exp_of_double(double &d, int exp)

Set the exponent part of a double from int. Domain of argument exp: [0, 2048)

static inline void set_man_of_double(double &d, uint64_t man)

Set the mantissa part of a double from uint64_t. Domain of argument uint64_t: [0, 4503599627370496)