pitrou commented on a change in pull request #10928:
URL: https://github.com/apache/arrow/pull/10928#discussion_r689496300



##########
File path: cpp/src/arrow/util/basic_decimal.h
##########
@@ -388,6 +399,31 @@ class ARROW_EXPORT BasicDecimal256 {
   /// \brief In-place division.
   BasicDecimal256& operator/=(const BasicDecimal256& right);
 
+  /// \brief Get the maximum decimal value (is not a valid value).
+  static inline constexpr BasicDecimal256 GetMaxSentinel() {
+#if ARROW_LITTLE_ENDIAN
+    return BasicDecimal256({std::numeric_limits<uint64_t>::max(),
+                            std::numeric_limits<uint64_t>::max(),
+                            std::numeric_limits<uint64_t>::max(),
+                            
static_cast<uint64_t>(std::numeric_limits<int64_t>::max())});
+#else
+    return 
BasicDecimal256({static_cast<uint64_t>(std::numeric_limits<int64_t>::max()),
+                            std::numeric_limits<uint64_t>::max(),
+                            std::numeric_limits<uint64_t>::max(),
+                            std::numeric_limits<uint64_t>::max()});
+#endif

Review comment:
       The former looks more desirable to me, as it can be computed at compile 
time.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to