vec_cmpgt

Purpose

Returns a vector containing the results of a greater-than comparison between each set of corresponding elements of the given vectors.

Syntax

d=vec_cmpgt(a, b)

Result and argument types

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

d a b
vector4double vector4double vector4double

Result value

The value of each element of the result is 1.0 if the corresponding element of a is greater than the corresponding element of b. Otherwise, the value is -1.0.

Formula

If (a[0] > b[0]) Then d[0] = 1.0 Else d[0] = -1.0
If (a[1] > b[1]) Then d[1] = 1.0 Else d[1] = -1.0
If (a[2] > b[2]) Then d[2] = 1.0 Else d[2] = -1.0
If (a[3] > b[3]) Then d[3] = 1.0 Else d[3] = -1.0

Example

a =  (10.0,  20.0, 30.0, -40.0)
b =  (20.0, -10.0, 10.0,  80.0)
d: (-1.0,   1.0,  1.0,  -1.0)