zoudan commented on code in PR #3214:
URL: https://github.com/apache/calcite/pull/3214#discussion_r1203314154
##########
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:
https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions
--
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]