Q: Modulo in custom class I am working on something that requires me to use very large numbers, so I am  making my own number class. Now one of the math operations that is completely necessary is the modulo operation, and I do not know of a way to do this. My class consists of an ArrayList of integers in reverse order, ex the number 5321 would look like 1235.

A: Remember modulo is the remainder. Posted below is some psudo code on how this could be done assuming you have a + operator and a - operator for your number class.
BigNum operator%(BigNum divisor)
{
    BigNum val = this;
    BigNum div = divisor;
    while(div < val)
    {
        div = div + divisor;
    }   

    return this - (div - divisor);
}

