vec_extract

Purpose

Returns the value of element b from the vector a.

Syntax

d=vec_extract(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
signed char vector signed char signed int
unsigned char vector unsigned char
vector bool char
signed short vector signed short
unsigned short vector unsigned short
vector bool short
signed int vector signed int
unsigned int vector unsigned int
vector bool int
signed long long vector signed long long
unsigned long long vector unsigned long long
vector bool long long
float vector float
double vector double

Result value

This function uses the modulo arithmetic on b to determine the element number. For example, if b is out of range, the compiler uses b modulo the number of elements in a to determine the element position.