pitrou commented on a change in pull request #10823: URL: https://github.com/apache/arrow/pull/10823#discussion_r679314766
########## File path: cpp/src/arrow/util/basic_decimal.h ########## @@ -54,6 +61,20 @@ class ARROW_EXPORT BasicDecimal128 { : high_bits_(high), low_bits_(low) {} #endif + /// \brief Create a BasicDecimal256 from the two's complement representation. + /// Input array is assumed to be in native endianness. +#if ARROW_LITTLE_ENDIAN + constexpr BasicDecimal128(const std::array<uint64_t, 2>& array) noexcept + : low_bits_(array[0]), high_bits_(static_cast<int64_t>(array[1])) {} +#else + constexpr BasicDecimal128(const std::array<uint64_t, 2>& array) noexcept + : high_bits_(static_cast<int64_t>(array[0])), low_bits_(array[1]) {} +#endif + + // XXX + BasicDecimal128(LittleEndianArrayTag, const std::array<uint64_t, 2>& array) noexcept + : BasicDecimal128(BitUtil::LittleEndianArray::ToNative(array)) {} Review comment: @bkietz What do you think about this constructor scheme? Is it ok, or is there a better option? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org