public double doubleValue ()

Converts this BigInteger to a ` double`

. This
conversion is similar to the
*narrowing primitive conversion* from ` double`

to
` float`

as defined in
The Java™ Language Specification:
if this BigInteger has too great a magnitude
to represent as a ` double`

, it will be converted to
`Double.NEGATIVE_INFINITY`

or `Double.POSITIVE_INFINITY`

as appropriate. Note that even when
the return value is finite, this conversion can lose
information about the precision of the BigInteger value.

` double`

.

@jls 5.1.3 Narrowing Primitive Conversion

public float floatValue ()

Converts this BigInteger to a ` float`

. This
conversion is similar to the
*narrowing primitive conversion* from ` double`

to
` float`

as defined in
The Java™ Language Specification:
if this BigInteger has too great a magnitude
to represent as a ` float`

, it will be converted to
`Float.NEGATIVE_INFINITY`

or `Float.POSITIVE_INFINITY`

as appropriate. Note that even when
the return value is finite, this conversion can lose
information about the precision of the BigInteger value.

` float`

.

@jls 5.1.3 Narrowing Primitive Conversion

public int intValue ()

Converts this BigInteger to an ` int`

. This
conversion is analogous to a
*narrowing primitive conversion* from ` long`

to
` int`

as defined in
The Java™ Language Specification:
if this BigInteger is too big to fit in an
` int`

, only the low-order 32 bits are returned.
Note that this conversion can lose information about the
overall magnitude of the BigInteger value as well as return a
result with the opposite sign.

` int`

.

intValueExact()

@jls 5.1.3 Narrowing Primitive Conversion

public long longValue ()

Converts this BigInteger to a ` long`

. This
conversion is analogous to a
*narrowing primitive conversion* from ` long`

to
` int`

as defined in
The Java™ Language Specification:
if this BigInteger is too big to fit in a
` long`

, only the low-order 64 bits are returned.
Note that this conversion can lose information about the
overall magnitude of the BigInteger value as well as return a
result with the opposite sign.

` long`

.

longValueExact()

@jls 5.1.3 Narrowing Primitive Conversion

Diagram: BigInteger, BigDecimal