Misunderstanding with BigIntegers - no suprises there then...
Hi
I have a function for breaking down (supposedly) a BigInteger into a list, depending on the base! It works when I send it all my small test cases, however, when I do actually try and send it a 'big integer' it falls over, what am I doing wrong? Typical call line:
cc.split(234752138651249763254, BigInteger.valueOf(23472))
I keep getting an error stating that it is out of bounds!
Many thanks, Ron
public List split(BigInteger x, BigInteger b)
{
BigInteger t;
List<BigInteger> lst =new ArrayList<BigInteger>();
while (x.compareTo(BigInteger.ZERO) > 0)
{
BigInteger[] qr = x.divideAndRemainder(b);
x = qr[0];
t = qr[1];
lst.add(t);
}
//System.out.println(l.toString());
return lst;
}

