Rational.CompareTo(Rational) Method

Definition

Compare this rational to the specified rational to determine their natural order.

[Android.Runtime.Register("compareTo", "(Landroid/util/Rational;)I", "")]
public int CompareTo (Android.Util.Rational? another);
[<Android.Runtime.Register("compareTo", "(Landroid/util/Rational;)I", "")>]
member this.CompareTo : Android.Util.Rational -> int

Parameters

another
Rational

the rational to be compared

Returns

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified rational.

Attributes

Exceptions

if another was null

Remarks

Compare this rational to the specified rational to determine their natural order.

#NaN is considered to be equal to itself and greater than all other Rational values. Otherwise, if the objects are not #equals equal, then the following rules apply:

<ul> <li>Positive infinity is greater than any other finite number (or negative infinity) <li>Negative infinity is less than any other finite number (or positive infinity) <li>The finite number represented by this rational is checked numerically against the other finite number by converting both rationals to a common denominator multiple and comparing their numerators. </ul>

Java documentation for android.util.Rational.compareTo(android.util.Rational).

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