다음을 통해 공유


Half.Compare(Int16, Int16) Method

Definition

Compares the two specified half-precision float values.

[Android.Runtime.Register("compare", "(SS)I", "", ApiSince=26)]
public static int Compare (short x, short y);
[<Android.Runtime.Register("compare", "(SS)I", "", ApiSince=26)>]
static member Compare : int16 * int16 -> int

Parameters

x
Int16

The first half-precision float value to compare.

y
Int16

The second half-precision float value to compare

Returns

The value 0 if x is numerically equal to y, a value less than 0 if x is numerically less than y, and a value greater than 0 if x is numerically greater than y

Attributes

Remarks

Compares the two specified half-precision float values. The following conditions apply during the comparison:

<ul> <li>#NaN is considered by this method to be equal to itself and greater than all other half-precision float values (including #POSITIVE_INFINITY)</li> <li>#POSITIVE_ZERO is considered by this method to be greater than #NEGATIVE_ZERO.</li> </ul>

Java documentation for android.util.Half.compare(short, short).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to