compare

Compare 2 values and return -1, 0 or 1 depending on if the 1st value is less than, equal to, more than the 2nd value.

Typically used in min, max or sort function’s lambda expression.

Parameters:

No. Type Comments
1 An ALFA scalar value 1st argument to compare
2 An ALFA scalar value 2nd argument to compare

Returns: int - 0 if 1st and 2nd value matches, -1 if 1st is less than 2nd, 1 if 1st is greater than 2nd.

Usages:

  • compare( first : <Scalar type>, second : < Scalar type> ) : int