0

I am trying to make a calculator app in Android Studio and want to store the numerical value in a variable.

What is the longest data type in Java which can store the max amount of decimals and what is its limit?

Anonymous
  • 835
  • 1
  • 5
  • 21

1 Answers1

1

looks like you need Big classes, like BigInteger and BigDecimal. also inspect other useful for your case classes extending Number:

AtomicInteger, AtomicLong, BigDecimal, BigInteger, Byte, Double, DoubleAccumulator, DoubleAdder, Float, Half, Integer, Long, LongAccumulator, LongAdder, Rational, Short

question about max size of these "Bigs" is answered HERE

snachmsm
  • 17,866
  • 3
  • 32
  • 74