andygrove commented on code in PR #1374:
URL: https://github.com/apache/datafusion-comet/pull/1374#discussion_r1956385448


##########
spark/src/test/scala/org/apache/spark/sql/CometTestBase.scala:
##########
@@ -116,12 +116,49 @@ abstract class CometTestBase
     require(absTol > 0 && absTol <= 1e-6, s"absTol $absTol is out of range (0, 
1e-6]")
 
     actualAnswer.toSeq.zip(expectedAnswer.toSeq).foreach {
+      case (actual: Float, expected: Float) =>
+        def isPosInfinity(value: Float): Boolean = {
+          value.isPosInfinity || value == 3.4028235e38
+        }
+
+        if ((actual.isNaN && expected.isNaN) ||
+          (isPosInfinity(actual) && isPosInfinity(expected)) ||
+          (actual.isNegInfinity && expected.isNegInfinity)) {
+          // ok
+        } else {
+
+          def almostEqual(a: Double, b: Double, tolerance: Double = 1e-6f): 
Boolean = {

Review Comment:
   Actually, the two implementations of `almostEqual` have different input 
types (float vs double).



-- 
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...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to