You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/01/06 04:49:51 UTC

[GitHub] [calcite] XuQianJin-Stars commented on a change in pull request #1723: [CALCITE-3684] Implement CBRT function

XuQianJin-Stars commented on a change in pull request #1723: [CALCITE-3684] Implement CBRT function
URL: https://github.com/apache/calcite/pull/1723#discussion_r363157427
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
 ##########
 @@ -1384,6 +1384,17 @@ public static double atan2(double b0, double b1) {
     return Math.atan2(b0, b1);
   }
 
+  // CBRT
+  /** SQL <code>CBRT</code> operator applied to BigDecimal values. */
+  public static double cbrt(BigDecimal b0) {
+    return Math.cbrt(b0.doubleValue());
+  }
+
+  /** SQL <code>CBRT</code> operator applied to double values. */
+  public static double cbrt(double b0) {
+    return Math.cbrt(b0);
+  }
 
 Review comment:
   > Maybe we don't need to name the parameter as `b0` since there is only one parameter. I think `b` is fine.
   
   well, I have changed it.

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


With regards,
Apache Git Services