toShortExact

fun toShortExact(): Short

Converts this BigDecimal to a short, checking for lost information. If this BigDecimal has a nonzero fractional part or is out of the possible range for a short result then an ArithmeticException is thrown.

Return

this BigDecimal converted to a short.

Since

1.5

Throws

if this has a nonzero fractional part, or will not fit in a short.