Download MetaTrader 5
  • Compare

Compare

Compares two values of type T.

int Compare(
    x,     // the first value
    y      // the second value
   );

Parameters

x

[in]  The first value to compare.

y

[in]  The first value to compare.

Return Value

Returns a number that expresses the ratio of the two compared values:

  • if the result is less than zero, x is less than y (x<y)
  • if the result is equal to zero, x is equal to y (x=y)
  • if the result is greater than zero, x is greater than y (x>y)