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

@ -96,11 +96,24 @@ public final class StrictMath {
/**
* The {@code double} value that is closer than any other to
* <i>pi</i>, the ratio of the circumference of a circle to its
* <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;
/**
* Returns the trigonometric sine of an angle. Special cases:
* <ul><li>If the argument is NaN or an infinity, then the