Since you asked for it, here is a BigInteger example:
BigInteger a = new BigInteger("yourNumberInStringFormA"); BigInteger b = new BigInteger("yourNumberInStringFormB"); BigInteger c = new BigInteger("yourNumberInStringFormC"); BigInteger x = a.divide(b.multiply(c));
Where "yourNumberInStringForm" is an optional minus sign and number (without spaces or commas). For example BigInteger z = new BigIntger("-3463634"); NB: BigInteger will actually return long for you if your number is in its range. longs end in L , as in:
long num = 372036854775807L;
The maximum length for a long is: 9,223,372,036,854,775,807. If your numbers are less than this, then your life will become easier to use long or long , its wrapper, on top of BigInteger . Since with long you do not need to use methods for division / multiplication, etc.
source share