vec_avg

Purpose

Returns a vector containing the rounded average of each set of corresponding elements of two given vectors.

Syntax

d=vec_avg(a, b)

Result and argument types

The following table describes the types of the returned value and the function arguments.

Table 1. Result and argument types
d a b
The same type as argument a vector signed char The same type as argument a
vector unsigned char
vector signed short
vector unsigned short
vector signed int
vector unsigned int

Result value

The value of each element of the result is the rounded average of the values of the corresponding elements of a and b.