BigDecimal.toBigInteger

Converts this {@code BigDecimal} to a {@code BigInteger}. This conversion is analogous to the <i>narrowing primitive conversion</i> from {@code double} to {@code long} as defined in <cite>The Java&trade; Language Specification</cite>: any fractional part of this {@code BigDecimal} will be discarded. Note that this conversion can lose information about the precision of the {@code BigDecimal} value. <p> To have an exception thrown if the conversion is inexact (in other words if a nonzero fractional part is discarded), use the {@link #toBigIntegerExact()} method.

@return this {@code BigDecimal} converted to a {@code BigInteger}. @jls 5.1.3 Narrowing Primitive Conversion

class BigDecimal
toBigInteger
()

Meta