|
inlineconstexpr |
Parameters
x, y: integral value arguments.xs...: floating value arguments.tup: non empty tuple of arguments.c: Conditional expression masking the operation.m: Logical value masking the operation.Return value
The value of the arithmetic mean of the arguments is returned.
For two integral parameters half the sum of x and y. No overflow occurs. If the sum is odd, the result is a rounded value at a distance guaranteed to be less than or equal to 0.5 of the average floating value, but may differ by unity from the truncation given by (x+y)/2. Moreover, as some architectures provide simd intrinsics to perform the operation, the scalar results may differ by one unit from simd ones which are system dependent.
However the dowward (respectively upward) options can be used to ensure the result is equivalent to the integral conversion of floor((x+y)/2), (respectively ceil((x+y)/2)).
strict the option ensures generally faster computation, but strict inequality. For integral type entries, these are similar to ceil((x+y)/2), but converted to an integral value.strict the option ensures generally faster computation, but strict inequality. For integral type entries, these are similar to floor((x+y)/2) but converted to an integral value.