PATCH: BigDecimal - libgcj/1596: setScale() missing from BigDecimal

Warren Levy
Wed Jan 10 01:44:00 GMT 2001

Here's a patch for libgcj/1596.  In fixing it a couple other bugs turned
up (in BigDecimal.divide).  Turns out the newScale arg to the divide
method wasn't properly checked for validity; and small newScale values
for BigDecimal.divide sometimes caused an IllegalArgumentException
because they caused a BigInteger.pow() with a negative value to be
attempted.  I took care of both of them and I'm checking in a test case to
Mauve for this.

Here's the patch I've checked in (to Classpath also).

2001-01-10  Warren Levy  <>

	Fix for PR libgcj/1596:
        * java/math/ (divide): Check newScale for validity.
        Ensure that BigInteger.pow() is called with a non-negative value.
        (setScale (int)): New public method.
        (setScale (int,int)): New public method.

More information about the Java-patches mailing list