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


##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -3053,6 +3053,22 @@ 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 acosd(b0.doubleValue());
+  }
+
+  /** SQL <code>ACOSD</code> operator applied to double values. */
+  public static double acosd(double b0) {
+    final double radians = Math.acos(b0);
+    if (Double.isFinite(radians)) {

Review Comment:
   How about extracting all these blocks of:
   ```
   if (Double.isFinite(radians)) {
     return Math.toDegrees(radians);
   } else {
     return Double.NaN;
   }
   ```
   into a single common auxiliary method?
       



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