rubenada commented on code in PR #3214:
URL: https://github.com/apache/calcite/pull/3214#discussion_r1202515931


##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -1854,6 +1854,20 @@ public static double acos(double b0) {
     return Math.acos(b0);
   }
 
+  // ACOSH
+  /** SQL <code>ACOSH</code> operator applied to BigDecimal values. */
+  public static double acosh(BigDecimal b0) {
+    return acosh(b0.doubleValue());
+  }
+
+  /** SQL <code>ACOSH</code> operator applied to double values. */
+  public static double acosh(double b0) {
+    if (b0 < 1) {
+      throw new IllegalArgumentException("Input parameter of acosh cannot be 
less than 1!");
+    }
+    return Math.log(Math.sqrt(b0 * b0 - 1.0) + b0);

Review Comment:
   For the newbies on trigonometric functions :) , is there any link you can 
provide to show where these formulas come from?



-- 
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: commits-unsubscr...@calcite.apache.org

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

Reply via email to