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

Linux: Floating point expressions aren't rounded correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 1.3.0
    • other-libs
    • x86
    • linux

      Name: asR10013 Date: 05/29/2000


          Test vm/misc/FloatingPointInline.java from regression testsuite fails
      on linux jdk1.3b07. The reason is the same described in bug 4105954.
      First and second testcases report incorrect floating point round scheme.
      Below is testcases descriptions and output.
      /**
      * First test:
      * The value tiny is near the minimum representable double.
      * Dividing tiny by small should get us a value
      * that is not representable.
      * Page 35 says the result should be "the representable value
      * nearest to the the infinitely precise result".
      * The nearest representable value is 0.0, being 4 times
      * nearer than Double.MIN_VALUE.
      * Multiply that by big and you should still get 0.0.
      * What you should not get is the extended-precision
      * value of (tiny/small) multiplied by big.
      * Note that the computation of tiny/small should
      * yield 0.0, whether it is an intermediate result or a
      * stored value.
      */
      ------------------------------ output --------------------------------
      $ java -version
      java version "1.3.0beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0beta-b07)
      Java HotSpot(TM) Client VM (build 1.3.0beta-b04, mixed mode)
      $ java FloatingPointInline
      Sigh: double range too big near 0
      Oops: arg double range too big near 0
      Oops: result double range too big near 0
              tiny: 1.0E-323
              tiny/small: 0.0
              (tiny/small)*big: 3.16E-322
              MIN_VALUE*big: 1.265E-321
              (tiny*big)/small: 3.16E-322
      <<the rest is skipped>>
      ----------------------------------------------------------------------
      /**
      * Second test:
      * Huge is near the maximum representable double.
      * Multiplying huge by small should get us a value that
      * is not representable, so should be Double.POSITIVE_INFINITY.
      * Divide that by big and you should still get Infinity.
      * What you should not get is the extended-precision
      * value of (huge*small) divided by big.
      */
      ------------------------------ output --------------------------------
      $ java -version
      java version "1.3.0beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0beta-b07)
      Java HotSpot(TM) Client VM (build 1.3.0beta-b04, mixed mode)
      $ java FloatingPointInline
      Sigh: double range too big near infinity
      Oops: arg double range too big near infinity
      Oops: result double range too big near infinity
              huge: 8.988465674311579E307
              huge*small: Infinity
              (huge*small)/big: 2.8088955232223683E306
      <<the rest is skipped>>
      ======================================================================

      ======================================================================

            duke J. Duke
            alssunw Als Als (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: