共用方式為


Math.AddExact Method

Definition

Overloads

AddExact(Int32, Int32)

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

AddExact(Int64, Int64)

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

AddExact(Int32, Int32)

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

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

Parameters

x
Int32

the first value

y
Int32

the second value

Returns

the result

Attributes

Remarks

Java documentation for java.lang.Math.addExact(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

AddExact(Int64, Int64)

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

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

Parameters

x
Int64

the first value

y
Int64

the second value

Returns

the result

Attributes

Remarks

Java documentation for java.lang.Math.addExact(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