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 int Compare (T? x, T? y);

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

Product Versions
.NET 8, 9