TotalOrderIeee754Comparer<T>.Compare(T, T) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- x
- T
The first number to compare.
- y
- T
The second number to compare.
A signed integer that indicates the relative values of x
and y
, as shown in the following table.
Value | Meaning |
---|---|
Less than zero | x is less than y |
Zero | x equals y |
Greater than zero | x is greater than y |
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.
Product | Versions |
---|---|
.NET | 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: