cpp/numeric/midpoint

Computes the midpoint of the integers, floating-points, or pointers and.

@1@.

@2@ . Use of this overload is ill-formed if is an incomplete type.

Return value
@1@ Half the sum of and. No overflow occurs. If and  have integer type and the sum is odd, the result is rounded towards. If and  have floating-point type, at most one inexact operation occurs.

@2@ If and  point to, respectively,  and  of the same array object  (for the purpose of pointer arithmetic), returns a pointer to  (or, equivalently ) where the division rounds towards zero. If and  do not point to elements of the same array object, the behavior is undefined.

Exceptions
Throws no exceptions.