Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cpp/src/arrow/vendored/fast_float/parse_number.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <limits>
#include <system_error>

#include "arrow/util/bit_util.h"

namespace arrow_vendored {
namespace fast_float {

Expand Down Expand Up @@ -108,6 +110,11 @@ from_chars_result from_chars(const char *first, const char *last,
word |= uint64_t(am.power2) << binary_format<T>::mantissa_explicit_bits();
word = pns.negative
? word | (uint64_t(1) << binary_format<T>::sign_index()) : word;
#if ARROW_LITTLE_ENDIAN == 0
if (std::is_same<T, float>::value) {
memcpy(&value, (char *)&word + 4, sizeof(T)); // extract value at offset 4-7 if float on big-endian
} else
#endif
memcpy(&value, &word, sizeof(T));
return answer;
}
Expand Down