vec_neg

Purpose

Returns a vector containing the negated value of the corresponding elements in the given vector.

Note: For vector signed long long, this function emulates the operation.

Syntax

d=vec_neg(a)

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
The same type as argument a vector signed char
vector signed short
vector signed int
vector signed long long
vector float
vector double

Result value

This function multiplies the value of each element in the given vector by -1.0 and then assigns the result to the corresponding elements in the result vector.