MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / to_float

Function to_float

Source/external/fast_float.h:638–649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636
637template<typename T>
638fastfloat_really_inline FASTFLOAT_CONSTEXPR20
639void to_float(bool negative, adjusted_mantissa am, T &value) {
640 using uint = typename binary_format<T>::equiv_uint;
641 uint word = (uint)am.mantissa;
642 word |= uint(am.power2) << binary_format<T>::mantissa_explicit_bits();
643 word |= uint(negative) << binary_format<T>::sign_index();
644#if FASTFLOAT_HAS_BIT_CAST
645 value = std::bit_cast<T>(word);
646#else
647 ::memcpy(&value, &word, sizeof(T));
648#endif
649}
650
651#if FASTFLOAT_SKIP_WHITE_SPACE // disabled by default
652template <typename = void>

Calls

no outgoing calls

Tested by

no test coverage detected