Uredi

Deli z drugimi prek


TotalOrderIeee754Comparer<T>.Compare(T, T) Method

Definition

Compares two numbers with IEEE 754 totalOrder semantic and returns a value indicating whether one is less than, equal to, or greater than the other.

public:
 virtual int Compare(T x, T y);
public int Compare (T? x, T? y);
abstract member Compare : 'T * 'T -> int
override this.Compare : 'T * 'T -> int
Public Function Compare (x As T, y As T) As Integer

Parameters

x
T

The first number to compare.

y
T

The second number to compare.

Returns

A signed integer that indicates the relative values of x and y, as shown in the following table.

Value Meaning
Less than zerox is less than y
Zerox equals y
Greater than zerox is greater than y

Implements

Remarks

IEEE 754 specification defines totalOrder as <= semantic. totalOrder(x,y) is true when the result of this method is less than or equal to 0.

Applies to