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

JDK-8202449 fix causes conformance test failure : api/java_util/Random/RandomGenerator/NextFloat.html

    XMLWordPrintable

Details

    • b26
    • b02

    Backports

      Description

        Two tests from this test group api/java_util/Random/RandomGenerator/NextFloat.html are failing after JDK-8202449 fix.

        The tests which are validating the spec : https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/util/random/RandomGenerator.html#nextFloat(float)

        "Implementation Requirements:
        The default implementation checks that bound is a positive finite float. Then invokes nextFloat(), scaling the result so that the final result lies between 0.0f (inclusive) and bound (exclusive)."

        It looks the possible cause for these failures is - RandomSupport:boundedNextFloat =>
        if (r >= bound) // may need to correct a rounding problem
                    r = Math.nextDown(r);

        May be this is
        if (r >= bound) // may need to correct a rounding problem
                    r = Math.nextDown(bound);

        Attachments

          Issue Links

            Activity

              People

                rgiulietti Raffaello Giulietti
                kganapureddy Krushnareddy Ganapureddy
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: