• Api Documentation
Show / Hide Table of Contents
  • System.Numerics
    • BigRational
      • Abs
      • Acos
      • Acosh
      • AcosPi
      • Addition
      • Asin
      • Asinh
      • AsinPi
      • Atan
      • Atan2
      • Atan2Pi
      • Atanh
      • AtanPi
      • BigRational
      • BitwiseOr
      • Cbrt
      • Ceiling
      • Clamp
      • CompareTo
      • CopySign
      • Cos
      • Cosh
      • CosPi
      • CreateChecked
      • CreateSaturating
      • CreateTruncating
      • Decrement
      • Division
      • Equality
      • Equals
      • Exp
      • Exp10
      • Exp10M1
      • Exp2
      • Exp2M1
      • Explicit
      • ExpM1
      • Factorial
      • Floor
      • GetHashCode
      • GreaterThan
      • GreaterThanOrEqual
      • Hypot
      • ILog10
      • ILog2
      • ILogB
      • Implicit
      • Increment
      • Inequality
      • IsInteger
      • IsNaN
      • LessThan
      • LessThanOrEqual
      • Log
      • Log10
      • Log10P1
      • Log2
      • Log2P1
      • LogP1
      • Max
      • MaxDigits
      • MaxMagnitude
      • MaxMagnitudeNumber
      • Min
      • MinMagnitude
      • MinMagnitudeNumber
      • Modulus
      • Multiply
      • NumDen
      • op_CheckedExplicit
      • Parse
      • Pi
      • Pow
      • Pow2
      • ReadFromBytes
      • RootN
      • Round
      • Sign
      • Sin
      • SinCos
      • SinCosPi
      • Sinh
      • SinPi
      • Sqrt
      • Subtraction
      • Tan
      • Tanh
      • TanPi
      • task_cpu
      • Tau
      • ToString
      • Truncate
      • TryFormat
      • TryParse
      • UnaryNegation
      • UnaryPlus
      • WriteToBytes
    • BigRational.CPU
      • abs
      • add
      • and
      • atan
      • bdi
      • cmp
      • cmpa
      • cmpi
      • CPU
      • dec
      • div
      • dup
      • equ
      • exp
      • fac
      • free
      • gcd
      • getd
      • getf
      • getr
      • gets
      • hash
      • idiv
      • imod
      • inc
      • inv
      • ipt
      • isi
      • lim
      • log
      • log2
      • lsb
      • mark
      • mod
      • msb
      • mul
      • neg
      • norm
      • or
      • pi
      • pop
      • popd
      • popi
      • popr
      • pow
      • push
      • rnd
      • shl
      • shr
      • sign
      • sin
      • sqr
      • sqrt
      • sub
      • swp
      • tor
      • tos
      • xor
    • BigRational.Integer
      • Abs
      • Add
      • Addition
      • BitwiseAnd
      • BitwiseOr
      • CompareTo
      • CreateChecked
      • CreateSaturating
      • CreateTruncating
      • Decrement
      • Divide
      • Division
      • DivRem
      • Equality
      • Equals
      • ExclusiveOr
      • Explicit
      • GetByteCount
      • GetHashCode
      • GreaterThan
      • GreaterThanOrEqual
      • GreatestCommonDivisor
      • Implicit
      • Increment
      • Inequality
      • Integer
      • IsEven
      • IsEvenInteger
      • IsNegative
      • IsOddInteger
      • IsOne
      • IsPositive
      • IsPow2
      • IsPowerOfTwo
      • IsZero
      • LeastCommonMultiple
      • LeftShift
      • LessThan
      • LessThanOrEqual
      • Log
      • Log10
      • Log2
      • Lsb
      • Max
      • MaxMagnitude
      • Min
      • MinMagnitude
      • MinusOne
      • ModPow
      • Modulus
      • Msb
      • Multiply
      • Multiply
      • Negate
      • One
      • OnesComplement
      • op_UnsignedRightShift
      • Parse
      • PopCount
      • Pow
      • Remainder
      • RightShift
      • RotateLeft
      • RotateRight
      • Shl
      • Shr
      • Sign
      • Subtract
      • Subtraction
      • ToByteArray
      • ToString
      • TrailingZeroCount
      • TryFormat
      • TryParse
      • TryWriteBytes
      • UnaryNegation
      • UnaryPlus
      • Zero
    • BigRational.SafeCPU
      • abs
      • add
      • and
      • atan
      • bdi
      • cmp
      • cmpa
      • cmpi
      • dec
      • div
      • dup
      • equ
      • exp
      • fac
      • free
      • gcd
      • getd
      • getf
      • getr
      • gets
      • hash
      • idiv
      • imod
      • inc
      • inv
      • ipt
      • isi
      • lim
      • log
      • log2
      • lsb
      • mark
      • mod
      • msb
      • mul
      • neg
      • norm
      • or
      • pi
      • pop
      • popd
      • popi
      • popr
      • pow
      • push
      • rnd
      • shl
      • shr
      • sign
      • sin
      • sqr
      • sqrt
      • sub
      • swp
      • tor
      • tos
      • xor
  • System.Numerics.Generic
    • Float<T>
      • Abs
      • Acos
      • Acosh
      • AcosPi
      • Addition
      • Asin
      • Asinh
      • AsinPi
      • Atan
      • Atan2
      • Atan2Pi
      • Atanh
      • AtanPi
      • BitCount
      • BitDecrement
      • BitIncrement
      • Cbrt
      • Ceiling
      • CompareTo
      • Cos
      • Cosh
      • CosPi
      • CreateChecked
      • CreateSaturating
      • CreateTruncating
      • Decrement
      • Division
      • E
      • Epsilon
      • Equality
      • Equals
      • Exp
      • Exp10
      • Exp2
      • Explicit
      • Float
      • Floor
      • FusedMultiplyAdd
      • GetHashCode
      • GreaterThan
      • GreaterThanOrEqual
      • Hypot
      • Ieee754Remainder
      • ILogB
      • Implicit
      • Increment
      • Inequality
      • IsEvenInteger
      • IsFinite
      • IsInfinity
      • IsInteger
      • IsNaN
      • IsNegative
      • IsNegativeInfinity
      • IsNormal
      • IsOddInteger
      • IsPositive
      • IsPositiveInfinity
      • IsPow2
      • IsRealNumber
      • IsSubnormal
      • LessThan
      • LessThanOrEqual
      • Log
      • Log10
      • Log2
      • Max
      • MaxDigits
      • MaxMagnitude
      • MaxMagnitudeNumber
      • MaxNumber
      • MaxValue
      • Min
      • MinMagnitude
      • MinMagnitudeNumber
      • MinNumber
      • MinValue
      • Modulus
      • Multiply
      • NaN
      • NegativeInfinity
      • NegativeZero
      • Parse
      • Pi
      • PositiveInfinity
      • Pow
      • Pow10
      • RootN
      • Round
      • ScaleB
      • Sign
      • Sin
      • SinCos
      • SinCosPi
      • Sinh
      • SinPi
      • Sqrt
      • Subtraction
      • Tan
      • Tanh
      • TanPi
      • Tau
      • ToString
      • Truncate
      • TryFormat
      • TryParse
      • UnaryNegation
      • UnaryPlus
    • Int<T>
      • Abs
      • Addition
      • BitwiseAnd
      • BitwiseOr
      • Clamp
      • CompareTo
      • CopySign
      • CreateChecked
      • CreateSaturating
      • CreateTruncating
      • Decrement
      • Division
      • DivRem
      • Equality
      • Equals
      • ExclusiveOr
      • Explicit
      • GetHashCode
      • GreaterThan
      • GreaterThanOrEqual
      • Implicit
      • Increment
      • Inequality
      • IsEvenInteger
      • IsNegative
      • IsOddInteger
      • IsPositive
      • IsPow2
      • LeadingZeroCount
      • LeftShift
      • LessThan
      • LessThanOrEqual
      • Log2
      • Max
      • MaxMagnitude
      • MaxValue
      • Min
      • MinMagnitude
      • MinValue
      • Modulus
      • Multiply
      • NegativeOne
      • One
      • OnesComplement
      • op_UnsignedRightShift
      • Parse
      • PopCount
      • RightShift
      • RotateLeft
      • RotateRight
      • Sign
      • Subtraction
      • ToString
      • TrailingZeroCount
      • TryFormat
      • TryParse
      • UnaryNegation
      • UnaryPlus
      • Zero
    • UInt<T>
      • Addition
      • BitwiseAnd
      • BitwiseOr
      • Clamp
      • CompareTo
      • CreateChecked
      • CreateSaturating
      • CreateTruncating
      • Decrement
      • Division
      • DivRem
      • Equality
      • Equals
      • ExclusiveOr
      • Explicit
      • GetHashCode
      • GreaterThan
      • GreaterThanOrEqual
      • Implicit
      • Increment
      • Inequality
      • IsEvenInteger
      • IsOddInteger
      • IsPow2
      • LeadingZeroCount
      • LeftShift
      • LessThan
      • LessThanOrEqual
      • Log2
      • Max
      • MaxValue
      • Min
      • MinValue
      • Modulus
      • Multiply
      • One
      • OnesComplement
      • op_UnsignedRightShift
      • Parse
      • PopCount
      • RightShift
      • RotateLeft
      • RotateRight
      • Sign
      • Subtraction
      • ToString
      • TrailingZeroCount
      • TryFormat
      • TryParse
      • UnaryPlus
      • Zero

Method CompareTo

CompareTo(Object)

Compares this object to another object, returning an instance of System.Relation.
Null is considered less than any instance.

Declaration
public int CompareTo(object obj)
Parameters
Type Name Description
System.Object obj

The object to compare.

Returns
Type Description
System.Int32

A signed integer value that indicates the relationship of this instance to other, as shown in the following table.
Return value – Description
Less than zero – The current instance is less than other.
Zero – The current instance equals other.
Greater than zero – The current instance is greater than other.

Exceptions
Type Condition
System.ArgumentException

If obj is not null and not of type BigRational.

CompareTo(BigRational)

Compares this instance to a second BigRational 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.

Declaration
public int CompareTo(BigRational b)
Parameters
Type Name Description
BigRational b

The object to compare.

Returns
Type Description
System.Int32

A signed integer value that indicates the relationship of this instance to other, as shown in the following table.
Return value – Description
Less than zero – The current instance is less than other.
Zero – The current instance equals other.
Greater than zero – The current instance is greater than other.

CompareTo(Int64)

Compares this instance to a second System.Int64 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.

Declaration
public int CompareTo(long b)
Parameters
Type Name Description
System.Int64 b

System.Int64 value to compare.

Returns
Type Description
System.Int32

A signed integer value that indicates the relationship of this instance to other, as shown in the following table.
Return value – Description
Less than zero – The current instance is less than other.
Zero – The current instance equals other.
Greater than zero – The current instance is greater than other.

Remarks

Fast shortcut for the most common comparisons like: x == 0; x <= 1; x != -1; etc.

In This Article
Back to top Generated by DocFX