normanj-bitquill commented on code in PR #3862:
URL: https://github.com/apache/calcite/pull/3862#discussion_r1687225134


##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -3053,6 +3053,17 @@ public static double acos(double b0) {
     return Math.acos(b0);
   }
 
+  // ACOSD
+  /** SQL <code>ACOSD</code> operator applied to BigDecimal values. */
+  public static double acosd(BigDecimal b0) {
+    return Math.toDegrees(Math.acos(b0.doubleValue()));

Review Comment:
   I did some testing and no this doesn't match PostgreSQL. I have updated to 
match the behaviour I observed in PostgreSQL.
   
   * ACOSD - returns NaN if input was NaN. Fails if outside of -1..1
   * ASIND - returns NaN if input was NaN. Fails if outside of -1..1
   * ATAND - returns NaN if input was NaN.
   * COSD - returns NaN if input was NaN. Fails if input is greater than max 
double.
   * SIND - returns NaN if input was NaN. Fails if input is greater than max 
double.
   * TAND - returns NaN if input was NaN. Fails if input is greater than max 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to