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

RFE: add an exponent range limit to BigInteger.pow() similar to the limit for BigDecimal.pow()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • None
    • sparc
    • solaris_10

      If you accidently pass too large of an exponent value to BigInteger.pow(), the jvm will essentially appear to hang to the end user. Although in reality, the jvm is just busy calculating a really huge number. An exponent range is provided with BigDecimal.pow() and an Arithmetic Exception is thrown if the exponent is too large. A similar limit should be included for BigIngeger.pow().

      At minimum, we should at least introduce a user defined upper limit. I have included a proposal for a source code modification in the comments section of this RFE.

            darcy Joe Darcy
            mhmccart Mary Mccarthy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: