Condividi tramite


BigDecimal.IntValueExact Method

Definition

Converts this BigDecimal to an int, checking for lost information.

[Android.Runtime.Register("intValueExact", "()I", "GetIntValueExactHandler")]
public virtual int IntValueExact ();
[<Android.Runtime.Register("intValueExact", "()I", "GetIntValueExactHandler")>]
abstract member IntValueExact : unit -> int
override this.IntValueExact : unit -> int

Returns

this BigDecimal converted to an int.

Attributes

Exceptions

if rounding is necessary or the number doesn't fit in an int.

Remarks

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

Added in 1.5.

Java documentation for java.math.BigDecimal.intValueExact().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to