Top Description Classes Enums
module java.base

Package java.math


Provides classes for performing arbitrary-precision integer arithmetic (BigInteger) and arbitrary-precision decimal arithmetic (BigDecimal). BigInteger is analogous to the primitive integer types except that it provides arbitrary precision, hence operations on BigIntegers do not overflow or lose precision. In addition to standard arithmetic operations, BigInteger provides modular arithmetic, GCD calculation, primality testing, prime generation, bit manipulation, and a few other miscellaneous operations. BigDecimal provides arbitrary-precision signed decimal numbers suitable for currency calculations and the like. BigDecimal gives the user complete control over rounding behavior, allowing the user to choose from a comprehensive set of eight rounding modes.
Since
1.1

Class Summary

Modifier and TypeClass and Description
public class
BigDecimal

Immutable, arbitrary-precision signed decimal numbers.

public class
BigInteger

Immutable arbitrary-precision integers.

pack-priv class
BitSieve

A simple bit sieve used for finding prime number candidates.

public class
MathContext

Immutable objects which encapsulate the context settings which describe certain rules for numerical operators, such as those implemented by the BigDecimal class.

pack-priv class
MutableBigInteger

A class used to represent multiprecision integers that makes efficient use of allocated space by allowing a number to occupy only part of an array so that the arrays do not have to be reallocated as often.

pack-priv class
SignedMutableBigInteger

A class used to represent multiprecision integers that makes efficient use of allocated space by allowing a number to occupy only part of an array so that the arrays do not have to be reallocated as often.

Enum Summary

Modifier and TypeEnum and Description
public enum
RoundingMode

Specifies a rounding policy for numerical operations capable of discarding precision.