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

java.util.Random.nextGaussian should specify StrictMath instead of Math methods

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 6
    • Fix Version/s: 6
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b23
    • CPU:
      generic
    • OS:
      generic

      Description

      The class java.util.Random is intended to provide cross-platform bit-for-bit reproducability of random numbers. However, the JavaDoc for the nextGaussian method is given in terms of Math.log; since 1.3 and the introduction of the StrictMath class, Math.log has not been required to get bitwise reproducible results across platforms. Therefore, to maintain the original intended specification of nextGaussian, the specification should require StrictMath.log instead of Math.log. (For clarity StrictMath.sqrt should be required instead of Math.sqrt although StrictMath.sqrt and Math.sqrt and defined, and required, to return the same results in all cases.)

      The possible behavioral differences between Math.log and StrictMath was not a de facto issue until the recent intrinsification of log, 6196383.

      ###@###.### 2005-1-25 06:34:57 GMT
      ###@###.### 2005-1-25 06:52:16 GMT

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              darcy Joe Darcy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: