public static int Midpoint(
int x,
int y
)Public Shared Function Midpoint (
x As Integer,
y As Integer
) As Integerpublic:
static int Midpoint(
int x,
int y
)static member Midpoint :
x : int *
y : int -> int The simple expression (x + y)/2 can overflow. The implementation of this method returns the accurate midpoint for all values of x and y, including all combinations of their extreme values.