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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 6
    • core-libs
    • b23
    • generic
    • generic

      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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: