tanclary commented on code in PR #3378:
URL: https://github.com/apache/calcite/pull/3378#discussion_r1301886422


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -7401,6 +7470,87 @@ private static void checkIf(SqlOperatorFixture f) {
     f.checkNull("safe_multiply(cast(3 as double), cast(null as bigint))");
   }
 
+  @Test void testSafeSubtractFunc() {

Review Comment:
   Done



##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -1859,7 +1983,7 @@ private static boolean safeDouble(double d) {
     // negated MIN and MAX double values, overflow has not occurred. Otherwise,
     // overflow has occurred. Important to note that 'Double.MIN_VALUE' refers 
to
     // minimum positive value.
-    if (d < Double.MAX_VALUE && d > Double.MIN_VALUE) {
+    if (d < Double.MAX_VALUE && d > Double.MIN_VALUE || d == 0) {

Review Comment:
   DOne



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