vec_promote

Purpose

Returns a vector with a in element position b.

Syntax

d=vec_promote(a, b)

Result and argument types

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

d a b
vector4double double int

Result value

The result is a vector with a in element position b. This function uses 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 the vector to determine the element position. The other elements of the vector are undefined.

Formula

d[b MOD 4] = a
Note: MOD is the modulo operator.

Example

a = 50.0
b = 1
d: ( X, 50.0, Y, Z) // X, Y, and Z are undefined values