public BigInteger remainder(BigInteger val) throws ArithmeticException
private int[] remainder(int[] x, int[] y)
    public BigInteger remainder(BigInteger val) throws ArithmeticException    {        if (val.sign == 0)        {            throw new ArithmeticException("BigInteger: Divide by zero");        }        if (sign == 0)        {            return BigInteger.ZERO;        }        int[] res = new int[this.magnitude.length];        System.arraycopy(this.magnitude, 0, res, 0, res.length);        return new BigInteger(sign, remainder(res, val.magnitude));    }