The Java TM Tutorial

| Start of Tutorial > Start of Trail > Start of Lesson | Search

Trail: To 1.1 -- And Beyond!
Lesson: What's New in 1.1?

## Math Package

> A new package, `java.math`, was added to the JDK 1.1 release. The math package contains two new classes: `BigInteger` and BigDecimal.

> `BigInteger` numbers are immutable arbitrary-precision integers. They provide analogs to all of Java's primitive integer operators and all relevant static methods from the `java.lang.Math` class. Additionally, `BigInteger` numbers provide operations for modular arithmetic, GCD calculation, primality testing, prime generation, single-bit manipulation, and a few other odds and ends.

> `BigDecimal` numbers are immutable, arbitrary-precision signed decimal numbers, suitable for monetary calculations. `BigDecimal` numbers provide operations for basic arithmetic, scale manipulation, comparison, format conversion, and hashing.

### Where to Find Documentation

- Currently, the only documentation available on these classes is the `javadoc`-generated API documentation: `java.math.BigInteger`, and `java.math.BigDecimal`

| Start of Tutorial > Start of Trail > Start of Lesson | Search