Harmony
  1. Harmony
  2. HARMONY-1248

[classlib][math] exception compatibility BigDecimal.valueOf(0L, -22).shortValueExact()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      ============= Spec ========================
      public short shortValueExact()
      Throws:
      ArithmeticException - if this has a nonzero fractional part, or
      will not fit in a short.

      ================ Test =========================
      import java.math.BigDecimal;

      public class Test {
      public static void main(String args[] )

      { BigDecimal.valueOf(0L, -22).shortValueExact(); }

      }

      ================ Output =====================
      RI throws java.lang.ArithmeticException: Overflow
      Harmony throws nothing, just return 0

      Actually BigDecimal.valueOf(0L, -22) equals 0E+22. So Harmony follows
      spec and looks absolutely logically.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        203d 9h 5m 1 Alexei Zakharov 13/Mar/07 15:59
        Alexei Zakharov made changes -
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Closed [ 6 ]
        Hide
        Alexei Zakharov added a comment -

        Seems to be a true NBD. Closed as WON'T FIX.

        Show
        Alexei Zakharov added a comment - Seems to be a true NBD. Closed as WON'T FIX.
        Hide
        Alexei Zakharov added a comment -

        In the given example the fraction part is zero and the value itself should fit to short type (since it is zero too). So it looks like RI behavior contradicts the spec.

        Show
        Alexei Zakharov added a comment - In the given example the fraction part is zero and the value itself should fit to short type (since it is zero too). So it looks like RI behavior contradicts the spec.
        Alexei Zakharov made changes -
        Assignee Alexei Zakharov [ zakha ]
        Alexei Zakharov made changes -
        Field Original Value New Value
        Priority Major [ 3 ] Minor [ 4 ]
        Denis Kishenko created issue -

          People

          • Assignee:
            Alexei Zakharov
            Reporter:
            Denis Kishenko
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development