MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / to_float

Function to_float

external/include/fast_float/fast_float.h:498–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496
497template<typename T>
498fastfloat_really_inline void to_float(bool negative, adjusted_mantissa am, T &value) {
499 uint64_t word = am.mantissa;
500 word |= uint64_t(am.power2) << binary_format<T>::mantissa_explicit_bits();
501 word = negative
502 ? word | (uint64_t(1) << binary_format<T>::sign_index()) : word;
503#if FASTFLOAT_IS_BIG_ENDIAN == 1
504 if (std::is_same<T, float>::value) {
505 ::memcpy(&value, (char *)&word + 4, sizeof(T)); // extract value at offset 4-7 if float on big-endian
506 } else {
507 ::memcpy(&value, &word, sizeof(T));
508 }
509#else
510 // For little-endian systems:
511 ::memcpy(&value, &word, sizeof(T));
512#endif
513}
514
515} // namespace fast_float
516

Callers 2

negative_digit_compFunction · 0.85
from_chars_advancedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected