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

Use minimal-length literals to initialize PI and E constants

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 19
    • core-libs
    • b14

      Depending on the range of the number line, a double value has between 15 and 17 digits of decimal precision. The literal used to initialize Math.PI and Math.E have several digits more precision than that maximum.

      That is potentially confusing to readers of the code and the minimum length strings to exactly represent the value in question should be used instead.

            darcy Joe Darcy
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: