JDK 9 RFR of 4477961: java.lang.Math.toDegrees(double) could be optimized

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue Sep 23 06:42:23 UTC 2014


Hi Brian,

On 09/23/2014 02:34 AM, Brian Burkhalter wrote:
> I created an alternate webrev using compile-time constants per your
> suggestion:
> 
> http://cr.openjdk.java.net/~bpb/4477961/webrev.01/
> <http://cr.openjdk.java.net/%7Ebpb/4477961/webrev.01/>

Ah, sorry for confusing language about "compile-time constants", I meant
"compile-time constant expression", as per JLS 15.28. Constant
expressions are FP-strict, so it should be just fine correctness- and
performance-wise, and less cryptic:
 private static final double DEGREES_TO_RADIANS = PI / 180.0;

Thanks,
-Aleksey.




More information about the core-libs-dev mailing list