public int intValueExact() {
       long num;
       num = this.longValueExact();     // will check decimal part
       if ((int)num != num)
           throw new java.lang.ArithmeticException("Overflow");
       return (int)num;
    }
public int intValueExact ( ) { long num ; num = this . longValueExact ( ) ; if ( ( int ) num != num ) throw new java . lang . ArithmeticException ( "Overflow" ) ; return ( int ) num ; }
Converts this {@code BigDecimal} to an {@code int}, checking
for lost information.  If this {@code BigDecimal} has a
nonzero fractional part or is out of the possible range for an
{@code int} result then an {@code ArithmeticException} is
thrown.

@return this {@code BigDecimal} converted to an {@code int}.
@throws ArithmeticException if {@code this} has a nonzero
fractional part, or will not fit in an {@code int}.
@since  1.5