MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / to_float

Function to_float

app/src/ThirdParty/fast_float.h:1314–1327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1312
1313template <typename T>
1314fastfloat_really_inline FASTFLOAT_CONSTEXPR20 void
1315to_float(bool negative, adjusted_mantissa am, T &value) {
1316 using equiv_uint = equiv_uint_t<T>;
1317 equiv_uint word = equiv_uint(am.mantissa);
1318 word = equiv_uint(word | equiv_uint(am.power2)
1319 << binary_format<T>::mantissa_explicit_bits());
1320 word =
1321 equiv_uint(word | equiv_uint(negative) << binary_format<T>::sign_index());
1322#if FASTFLOAT_HAS_BIT_CAST
1323 value = std::bit_cast<T>(word);
1324#else
1325 ::memcpy(&value, &word, sizeof(T));
1326#endif
1327}
1328
1329template <typename = void> struct space_lut {
1330 static constexpr bool value[] = {

Calls

no outgoing calls

Tested by

no test coverage detected