Skip to content
Permalink
Browse files
8283124: Add constant for tau to Math and StrictMath
Reviewed-by: bpb, iris
  • Loading branch information
jddarcy committed Mar 15, 2022
1 parent 671b6ef commit 05a83e03ca35b4885b48bb0e7d188baf8f7d9d7f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
@@ -135,11 +135,24 @@ private 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.
@@ -96,11 +96,24 @@ private 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

1 comment on commit 05a83e0

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.