Math.abs corner case with optimistic typing

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 10
    • Affects Version/s: None
    • Component/s: 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

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

              Created:
              Updated:
              Resolved: