Compartir a través de


StrictMath.DivideExact Method

Definition

Overloads

DivideExact(Int32, Int32)

Returns the quotient of the arguments, throwing an exception if the result overflows an int.

DivideExact(Int64, Int64)

Returns the quotient of the arguments, throwing an exception if the result overflows a long.

DivideExact(Int32, Int32)

Returns the quotient of the arguments, throwing an exception if the result overflows an int.

[Android.Runtime.Register("divideExact", "(II)I", "", ApiSince=35)]
public static int DivideExact (int x, int y);
[<Android.Runtime.Register("divideExact", "(II)I", "", ApiSince=35)>]
static member DivideExact : int * int -> int

Parameters

x
Int32

the dividend

y
Int32

the divisor

Returns

the quotient x / y

Attributes

Remarks

Returns the quotient of the arguments, throwing an exception if the result overflows an int. Such overflow occurs in this method if x is Integer#MIN_VALUE and y is -1. In contrast, if Integer.MIN_VALUE / -1 were evaluated directly, the result would be Integer.MIN_VALUE and no exception would be thrown.

If y is zero, an ArithmeticException is thrown (JLS {

Added in 18.

Java documentation for java.lang.StrictMath.divideExact(int, int).

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

DivideExact(Int64, Int64)

Returns the quotient of the arguments, throwing an exception if the result overflows a long.

[Android.Runtime.Register("divideExact", "(JJ)J", "", ApiSince=35)]
public static long DivideExact (long x, long y);
[<Android.Runtime.Register("divideExact", "(JJ)J", "", ApiSince=35)>]
static member DivideExact : int64 * int64 -> int64

Parameters

x
Int64

the dividend

y
Int64

the divisor

Returns

the quotient x / y

Attributes

Remarks

Returns the quotient of the arguments, throwing an exception if the result overflows a long. Such overflow occurs in this method if x is Long#MIN_VALUE and y is -1. In contrast, if Long.MIN_VALUE / -1 were evaluated directly, the result would be Long.MIN_VALUE and no exception would be thrown.

If y is zero, an ArithmeticException is thrown (JLS {

Added in 18.

Java documentation for java.lang.StrictMath.divideExact(long, long).

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