vec_cmpeq

Purpose

Returns a vector containing the results of comparing each set of corresponding elements of the given vectors for equality.

Syntax

d=vec_cmpeq(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 equal to the corresponding element of b. Otherwise, the value is -1.0.

Formula

If (a[0] EQ b[0]) Then d[0] = 1.0 Else d[0] = -1.0
If (a[1] EQ b[1]) Then d[1] = 1.0 Else d[1] = -1.0
If (a[2] EQ b[2]) Then d[2] = 1.0 Else d[2] = -1.0
If (a[3] EQ b[3]) Then d[3] = 1.0 Else d[3] = -1.0
Note: EQ is the equal operator.

Example

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