Decimal point position in result is wrong for non-integral numbers.
Sign is wrong for negative numbers.
==== Here is the minimized test demonstrating the bug ====
class java_lang_Bignum_pow {
public static void main(String args[]) {
Bignum b1=new Bignum("2.0");
Bignum b2=new Bignum("-2");
System.out.println(b1.pow(2)); //should print "4.0"
System.out.println(b2.pow(2)); //should print "4"
}
}
==== Here is the test output ====
40.0
-4
Sign is wrong for negative numbers.
==== Here is the minimized test demonstrating the bug ====
class java_lang_Bignum_pow {
public static void main(String args[]) {
Bignum b1=new Bignum("2.0");
Bignum b2=new Bignum("-2");
System.out.println(b1.pow(2)); //should print "4.0"
System.out.println(b2.pow(2)); //should print "4"
}
}
==== Here is the test output ====
40.0
-4
- relates to
-
JDK-4014785 java.lang.Bignum.pow() method works wrong with negative exponents
-
- Closed
-
-
JDK-4014270 java.lang.Bignum.ZERO.pow(-1) does not throw an exception
-
- Closed
-