共用方式為


Double.Compare(Double, Double) Method

Definition

Compares the two specified double values.

[Android.Runtime.Register("compare", "(DD)I", "")]
public static int Compare (double d1, double d2);
[<Android.Runtime.Register("compare", "(DD)I", "")>]
static member Compare : double * double -> int

Parameters

d1
Double

the first double to compare

d2
Double

the second double to compare

Returns

the value 0 if d1 is numerically equal to d2; a value less than 0 if d1 is numerically less than d2; and a value greater than 0 if d1 is numerically greater than d2.

Attributes

Remarks

Compares the two specified double values. The sign of the integer value returned is the same as that of the integer that would be returned by the call:

new Double(d1).compareTo(new Double(d2))

Added in 1.4.

Java documentation for java.lang.Double.compare(double, double).

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