8283124: Add constant for tau to Math and StrictMath

Reviewed-by: bpb, iris
This commit is contained in:
Joe Darcy 2022-03-15 16:22:11 +00:00
parent 671b6efd61
commit 05a83e03ca
2 changed files with 29 additions and 3 deletions

View file

@ -135,11 +135,24 @@ public final class Math {
/**
* 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.
* <i>pi</i> (&pi;), the ratio of the circumference of a circle to
* its diameter.
*/
public static final double PI = 3.141592653589793;
/**
* The {@code double} value that is closer than any other to
* <i>tau</i> (&tau;), the ratio of the circumference of a circle
* to its radius.
*
* @apiNote
* The value of <i>pi</i> is one half that of <i>tau</i>; in other
* words, <i>tau</i> is double <i>pi</i> .
*
* @since 19
*/
public static final double TAU = 2.0 * PI;
/**
* Constant by which to multiply an angular value in degrees to obtain an
* angular value in radians.