equal
The equal function takes two arguments of any basic type, that is, any scalar or vector type of bool, int, uint or float.
bool equal(T x, T y)
The return value of the equal function is a bool that is true if x and y are equal or false otherwise. The function tests for exact equality between the values of x and y.
The equal function performs an exact numeric comparison between x and y. For float values, the function simply tests whether the values are bit-for-bit identical. For integer values, the function tests whether they are exactly equal.
For vector types, the comparison is performed component-wise. That is, each component of x is compared with the corresponding component of y, and if all components are equal, the function returns true. Otherwise, it returns false.
The following example demonstrates the use of the equal function to compare two float values and two vec3 vectors:
float a = 2.5;
float b = 2.5;
vec3 v1 = vec3(1.0, 2.0, 3.0);
vec3 v2 = vec3(1.0, 2.0, 3.0);
bool c = equal(a, b); // returns true
bool d = equal(v1, v2); // returns true