Troll dé Mage Troll dé Mage - 5 months ago 51
Java Question

A Variable That Doesn't Overflow

I've been working with some very big numbers lately, and it has gone to the extent where even my longs overflow. Is there any variable that never overflows?

Answer

Maybe you should use BigInteger, but is is a class type, not a variable.

BigInteger bi = BigInteger.valueOf(num);