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/13 11:49:52 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #7826: ARROW-9495: [C++] Equality assertions don't handle Inf / -Inf properly

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



##########
File path: cpp/src/arrow/compare.cc
##########
@@ -113,8 +113,9 @@ inline bool FloatingApproxEquals(const NumericArray<ArrowType>& left,
       return (fabs(x - y) <= epsilon) || (std::isnan(x) && std::isnan(y));
     });
   } else {
-    return BaseFloatingEquals<ArrowType>(
-        left, right, [epsilon](T x, T y) -> bool { return fabs(x - y) <= epsilon; });
+    return BaseFloatingEquals<ArrowType>(left, right, [epsilon](T x, T y) -> bool {
+      return (fabs(x - y) <= epsilon) || (x == y);
+    });

Review comment:
       You must also change the `nans_equal` path above.




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