bkietz commented on code in PR #46866:
URL: https://github.com/apache/arrow/pull/46866#discussion_r2166977331


##########
cpp/src/arrow/util/hashing.h:
##########
@@ -143,6 +144,21 @@ struct ScalarHelper<Scalar, AlgNum, 
enable_if_t<std::is_floating_point<Scalar>::
   }
 };
 
+template <typename Scalar, uint64_t AlgNum>
+struct ScalarHelper<Scalar, AlgNum,
+                    enable_if_t<std::is_same_v<Scalar, 
::arrow::util::Float16>>>
+    : public ScalarHelperBase<Scalar, AlgNum> {
+  // ScalarHelper specialization for Float16
+
+  static bool CompareScalars(Scalar u, Scalar v) {
+    if (u.is_nan()) {
+      // XXX should we do a bit-precise comparison?

Review Comment:
   FWIW: I meant to say that I think the current behavior of considering all 
NaNs equivalent is correct and the comment should be removed.



##########
cpp/src/arrow/util/hashing.h:
##########
@@ -143,6 +144,21 @@ struct ScalarHelper<Scalar, AlgNum, 
enable_if_t<std::is_floating_point<Scalar>::
   }
 };
 
+template <typename Scalar, uint64_t AlgNum>
+struct ScalarHelper<Scalar, AlgNum,
+                    enable_if_t<std::is_same_v<Scalar, 
::arrow::util::Float16>>>
+    : public ScalarHelperBase<Scalar, AlgNum> {
+  // ScalarHelper specialization for Float16
+
+  static bool CompareScalars(Scalar u, Scalar v) {
+    if (u.is_nan()) {
+      // XXX should we do a bit-precise comparison?

Review Comment:
   FWIW: I meant to say that I think the current behavior of considering all 
NaNs equivalent is correct and the comments should be removed.



-- 
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