You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/08/26 03:05:44 UTC

[GitHub] [arrow] kiszk commented on a change in pull request #8036: ARROW-9811: [C++] Unchecked floating point division by 0 should succeed

kiszk commented on a change in pull request #8036:
URL: https://github.com/apache/arrow/pull/8036#discussion_r477005207



##########
File path: cpp/src/arrow/compare.cc
##########
@@ -875,9 +879,26 @@ class ScalarEqualsVisitor {
     return Status::OK();
   }
 
+  template <typename T>
+  typename std::enable_if<std::is_base_of<FloatScalar, T>::value ||
+                              std::is_base_of<DoubleScalar, T>::value,
+                          Status>::type
+  Visit(const T& left_) {
+    const auto& right = checked_cast<const T&>(right_);
+    if (options_.nans_equal()) {
+      result_ = right.value == left_.value ||
+                (std::isnan(right.value) && std::isnan(left_.value));

Review comment:
       Just confirmation. Is it fine with `(NAN, -NAN) -> true`?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org