BigDecimal.CompareTo Method
Definition
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.
Overloads
| CompareTo(BigDecimal) |
Compares this |
| CompareTo(BigDecimal, MathContext) |
Compares this |
CompareTo(BigDecimal)
Compares this BigDecimal to another, using unlimited precision.
[Android.Runtime.Register("compareTo", "(Landroid/icu/math/BigDecimal;)I", "GetCompareTo_Landroid_icu_math_BigDecimal_Handler", ApiSince=24)]
public virtual int CompareTo(Android.Icu.Math.BigDecimal? rhs);
[<Android.Runtime.Register("compareTo", "(Landroid/icu/math/BigDecimal;)I", "GetCompareTo_Landroid_icu_math_BigDecimal_Handler", ApiSince=24)>]
abstract member CompareTo : Android.Icu.Math.BigDecimal -> int
override this.CompareTo : Android.Icu.Math.BigDecimal -> int
Parameters
- rhs
- BigDecimal
The BigDecimal for the right hand side of the comparison.
Returns
An int whose value is -1, 0, or 1 as this is numerically less than, equal to,
or greater than rhs.
- Attributes
Remarks
Compares this BigDecimal to another, using unlimited precision.
The same as #compareTo(BigDecimal, MathContext), where the BigDecimal is rhs, and the context is new MathContext(0, MathContext.PLAIN).
Java documentation for android.icu.math.BigDecimal.compareTo(android.icu.math.BigDecimal).
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
CompareTo(BigDecimal, MathContext)
Compares this BigDecimal to another.
[Android.Runtime.Register("compareTo", "(Landroid/icu/math/BigDecimal;Landroid/icu/math/MathContext;)I", "GetCompareTo_Landroid_icu_math_BigDecimal_Landroid_icu_math_MathContext_Handler", ApiSince=24)]
public virtual int CompareTo(Android.Icu.Math.BigDecimal? rhs, Android.Icu.Math.MathContext? set);
[<Android.Runtime.Register("compareTo", "(Landroid/icu/math/BigDecimal;Landroid/icu/math/MathContext;)I", "GetCompareTo_Landroid_icu_math_BigDecimal_Landroid_icu_math_MathContext_Handler", ApiSince=24)>]
abstract member CompareTo : Android.Icu.Math.BigDecimal * Android.Icu.Math.MathContext -> int
override this.CompareTo : Android.Icu.Math.BigDecimal * Android.Icu.Math.MathContext -> int
Parameters
- rhs
- BigDecimal
The BigDecimal for the right hand side of the comparison.
- set
- MathContext
The MathContext arithmetic settings.
Returns
An int whose value is -1, 0, or 1 as this is numerically less than, equal to,
or greater than rhs.
- Attributes
Remarks
Compares this BigDecimal to another.
Implements numeric comparison, (as defined in the decimal documentation, see BigDecimal class header), and returns a result of type int.
The result will be: <table cellpadding=2> <tr> <td align=right><b>-1</b></td> <td>if the current object is less than the first parameter</td> </tr> <tr> <td align=right><b>0</b></td> <td>if the current object is equal to the first parameter</td> </tr> <tr> <td align=right><b>1</b></td> <td>if the current object is greater than the first parameter.</td> </tr> </table>
A #compareTo(BigDecimal) method is also provided.
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.