8283143: Use minimal-length literals to initialize PI and E constants

Reviewed-by: smarks
This commit is contained in:
Joe Darcy 2022-03-15 16:05:37 +00:00
parent f43ffe211f
commit 671b6efd61
2 changed files with 5 additions and 5 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -131,14 +131,14 @@ public final class Math {
* The {@code double} value that is closer than any other to
* <i>e</i>, the base of the natural logarithms.
*/
public static final double E = 2.7182818284590452354;
public static final double E = 2.718281828459045;
/**
* The {@code double} value that is closer than any other to
* <i>pi</i>, the ratio of the circumference of a circle to its
* diameter.
*/
public static final double PI = 3.14159265358979323846;
public static final double PI = 3.141592653589793;
/**
* Constant by which to multiply an angular value in degrees to obtain an

View file

@ -92,14 +92,14 @@ public final class StrictMath {
* The {@code double} value that is closer than any other to
* <i>e</i>, the base of the natural logarithms.
*/
public static final double E = 2.7182818284590452354;
public static final double E = 2.718281828459045;
/**
* The {@code double} value that is closer than any other to
* <i>pi</i>, the ratio of the circumference of a circle to its
* diameter.
*/
public static final double PI = 3.14159265358979323846;
public static final double PI = 3.141592653589793;
/**
* Returns the trigonometric sine of an angle. Special cases: