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

BigDecimal("1E" + Integer.MIN_VALUE) throws erroneous exception

XMLWordPrintable

    • beta3
    • generic
    • generic
    • Verified

      The specs for BigDecimal string constructor state that "The value of the exponenet must lie between Integer.MIN_VALUE and Integer.MAX_VALUE, inclusive." However, a call

      BigDecimal("1E" + Integer.MIN_VALUE)

      fails with a java.lang.ArithmeticException: Negative exponent from the BigInteger.pow method.

      Either the spec should be changed on the JavaDoc should be modified.

            darcy Joe Darcy
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: