nfloat.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(nfloat) |
Compares this instance to a specified nfloat floating-point number and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified nfloat floating-point number. |
CompareTo(Object) |
Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object. |
CompareTo(nfloat)
Compares this instance to a specified nfloat floating-point number and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified nfloat floating-point number.
public int CompareTo (nfloat value);
abstract member CompareTo : nfloat -> int
override this.CompareTo : nfloat -> int
Parameters
- value
- nfloat
Returns
Implements
Applies to
CompareTo(Object)
Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object.
public int CompareTo (object value);
abstract member CompareTo : obj -> int
override this.CompareTo : obj -> int
Parameters
- value
- Object
An object to compare, or null.
Returns
A signed number indicating the relative values of this instance and value
.
Value |
Description |
---|---|
A negative integer |
This instance is less than -or- This instance is not a number (NaN) and |
Zero |
This instance is equal to -or- This instance and |
A positive integer |
This instance is greater than -or- This instance is a number and -or-
|
Implements
Remarks
The value
parameter must be null or an instance of nfloat; otherwise, an exception is thrown. Any instance of nfloat, regardless of its value, is considered greater than null.
Values must be identical to be considered equal. Particularly when floating-point values depend on multiple mathematical operations, it is common for them to lose precision and for their values to be nearly identical except for their least significant digits. Because of this, the return value of the CompareTo(Object) method at times may seem surprising.