Sdílet prostřednictvím


StrictMath.MultiplyExact Method

Definition

Overloads

MultiplyExact(Int32, Int32)

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

MultiplyExact(Int64, Int32)

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

MultiplyExact(Int64, Int64)

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

MultiplyExact(Int32, Int32)

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

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

Parameters

x
Int32

the first value

y
Int32

the second value

Returns

the result

Attributes

Remarks

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

Added in 1.8.

Java documentation for java.lang.StrictMath.multiplyExact(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

MultiplyExact(Int64, Int32)

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

[Android.Runtime.Register("multiplyExact", "(JI)J", "", ApiSince=31)]
public static long MultiplyExact (long x, int y);
[<Android.Runtime.Register("multiplyExact", "(JI)J", "", ApiSince=31)>]
static member MultiplyExact : int64 * int -> int64

Parameters

x
Int64

the first value

y
Int32

the second value

Returns

the result

Attributes

Remarks

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

Added in 9.

Java documentation for java.lang.StrictMath.multiplyExact(long, 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

MultiplyExact(Int64, Int64)

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

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

Parameters

x
Int64

the first value

y
Int64

the second value

Returns

the result

Attributes

Remarks

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

Added in 1.8.

Java documentation for java.lang.StrictMath.multiplyExact(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