| 496 | |
| 497 | template<typename T> |
| 498 | fastfloat_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 |
no outgoing calls
no test coverage detected