-
Bug
-
Resolution: Fixed
-
P3
-
1.1
-
1.1
-
sparc
-
solaris_2.5
-
Not verified
These methods work wrong with negative or non-integral parameters.
==== Here is the minimized test demonstrating the bug ====
import java.lang.Bignum;
class java_lang_Bignum_integerDivide {
public static void main(String args[]) {
Bignum b1=new Bignum("35.12");
Bignum b2=new Bignum("5");
System.out.println(b1.integerDivide(b2)[0]); // should print 7
System.out.println(b1.integerDivide(b2)[1]); // should print 0.12
System.out.println(b1.remainder(b2)); // should print 0.12
b1=new Bignum("-35");
b2=new Bignum("5");
System.out.println(b1.integerDivide(b2)[0]); // should print -7
System.out.println(b1.integerDivide(b2)[1]); // should print 0
System.out.println(b1.remainder(b2)); // should print 0
}
}
===== Here is the output of the test =====
7
.02
.02
0
-35
-35
==== Here is the minimized test demonstrating the bug ====
import java.lang.Bignum;
class java_lang_Bignum_integerDivide {
public static void main(String args[]) {
Bignum b1=new Bignum("35.12");
Bignum b2=new Bignum("5");
System.out.println(b1.integerDivide(b2)[0]); // should print 7
System.out.println(b1.integerDivide(b2)[1]); // should print 0.12
System.out.println(b1.remainder(b2)); // should print 0.12
b1=new Bignum("-35");
b2=new Bignum("5");
System.out.println(b1.integerDivide(b2)[0]); // should print -7
System.out.println(b1.integerDivide(b2)[1]); // should print 0
System.out.println(b1.remainder(b2)); // should print 0
}
}
===== Here is the output of the test =====
7
.02
.02
0
-35
-35