Thers a class called BigInt and it has a size and digit. size is the number of digits in the integer that is entered and digit is an array that holds the integer.
I have to write a method that multiplies them. I tried using two for loops to go through each index and multiply them. I think one of my problems is that im storing the product too soon or just wrong.
any help or a push in the right direction would be appreciated.
this is what i have so far
// multiply two BigInts
public BigInt times(BigInt other)
//Declare i and initialize carry
int i,j, temp;
int carry = 0;
//create product object
BigInt product = new BigInt();
//set size of product
product.size = this.size + other.size;
//Loops to run through elements of array and multiply
for(i = this.size; i >= 0; i--)
for(j = other.size; j >= 0; j--)
temp = this.digit[i] * other.digit[j];
product.digit[i+j] = temp % 10;
carry = temp / 10;
System.out.println(i + " Temp is " + temp);
System.out.println("sum.digit[" + i +"] is " + product.digit[i]);