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

Math.abs corner case with optimistic typing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 10
    • None
    • core-libs
    • None
    • b32
    • generic
    • generic

      Script:

      print(Math.abs(java.lang.Integer.MIN_VALUE))
      print(Math.abs(-2147483648))

      Expected output:

      2147483648
      2147483648

      Output seen with optimistic types enabled (default mode)

      -2147483648
      2147483648

      Output seen with optimistic types disabled (same as expected output)

      $ jjs -ot=false t.js
      2147483648
      2147483648

            sundar Sundararajan Athijegannathan
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: