JDK 10 RFR of JDK-8183173: Add private constructors to Fdlibm-internal classes

joe darcy joe.darcy at oracle.com
Wed Jun 28 23:06:00 UTC 2017


Hello,

Please review the patch below to address

     JDK-8183173: Add private constructors to Fdlibm-internal classes

There are four fdblim methods ported to Java (so far) and thus four 
constructors added.

Thanks,

-Joe

diff -r c150ee32ec89 src/java.base/share/classes/java/lang/FdLibm.java
--- a/src/java.base/share/classes/java/lang/FdLibm.java    Wed Jun 28 
11:27:29 2017 -0700
+++ b/src/java.base/share/classes/java/lang/FdLibm.java    Wed Jun 28 
16:04:43 2017 -0700
@@ -116,6 +116,10 @@
          private static final double F =  0x1.9b6db6db6db6ep0;  // 
45/28   ~= 1.60714285714285720630e+00
          private static final double G =  0x1.6db6db6db6db7p-2; //    
5/14   ~= 3.57142857142857150787e-01

+        private Cbrt() {
+            throw new UnsupportedOperationException();
+        }
+
          public static strictfp double compute(double x) {
              double  t = 0.0;
              double sign;
@@ -195,6 +199,10 @@
          public static final double TWO_MINUS_600 = 0x1.0p-600;
          public static final double TWO_PLUS_600  = 0x1.0p+600;

+        private Hypot() {
+            throw new UnsupportedOperationException();
+        }
+
          public static strictfp double compute(double x, double y) {
              double a = Math.abs(x);
              double b = Math.abs(y);
@@ -331,6 +339,10 @@
       *      representable.
       */
      public static class Pow {
+        private Pow() {
+            throw new UnsupportedOperationException();
+        }
+
          public static strictfp double compute(final double x, final 
double y) {
              double z;
              double r, s, t, u, v, w;
@@ -664,6 +676,10 @@
          private static final double P4   = -0x1.bbd41c5d26bf1p-20; // 
-1.65339022054652515390e-06
          private static final double P5   =  0x1.6376972bea4d0p-25; //  
4.13813679705723846039e-08

+        private Exp() {
+            throw new UnsupportedOperationException();
+        }
+
          // should be able to forgo strictfp due to controlled 
over/underflow
          public static strictfp double compute(double x) {
              double y;



More information about the core-libs-dev mailing list