Search code examples
javabigintegerbigdecimal

Why we don't see much use of BigInteger?


I'm a beginner in java and our professor avoided discussing BinInteger and BigDecimal classes from java.math package.I wonder why.Are they not that useful?When exactly we must need to use BigInteger?


Solution

  • You don't need them particularly often, but when you do need them you really need them. You really only need them when you need to actually store arbitrary precision integers or real numbers. long goes up to 263-1, which is a pretty big number.