Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8283136

Add constant for tau to Math and StrictMath

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 19
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Adding a static constant.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Add a constant for tau, a value equal to pi*2.

      Problem

      Many mathematical formulas use "2*pi" as a value, making giving that quantity a distinct name useful.

      Solution

      Add a constant for tau to java.lang.Math and java.lang.StrictMath, alongside the constants for pi.

      Specification

      In both java.lang.Math and java.lang.StrictMath add:

      /**
       * 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;

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              darcy Joe Darcy
              Reviewed By:
              Brian Burkhalter
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: