• 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

Class BigRational.Integer

Represents an arbitrarily large signed integer.

Inheritance
System.Object
BigRational.Integer
Implements
System.IComparable
System.IComparable<BigRational.Integer>
System.IEquatable<BigRational.Integer>
System.IFormattable
System.ISpanFormattable
System.Numerics.IBinaryInteger<BigRational.Integer>
System.IParsable<BigRational.Integer>
System.ISpanParsable<BigRational.Integer>
System.Numerics.IAdditionOperators<BigRational.Integer, BigRational.Integer, BigRational.Integer>
System.Numerics.IAdditiveIdentity<BigRational.Integer, BigRational.Integer>
System.Numerics.IBinaryNumber<BigRational.Integer>
System.Numerics.IBitwiseOperators<BigRational.Integer, BigRational.Integer, BigRational.Integer>
System.Numerics.IComparisonOperators<BigRational.Integer, BigRational.Integer, System.Boolean>
System.Numerics.IEqualityOperators<BigRational.Integer, BigRational.Integer, System.Boolean>
System.Numerics.IDecrementOperators<BigRational.Integer>
System.Numerics.IDivisionOperators<BigRational.Integer, BigRational.Integer, BigRational.Integer>
System.Numerics.IIncrementOperators<BigRational.Integer>
System.Numerics.IModulusOperators<BigRational.Integer, BigRational.Integer, BigRational.Integer>
System.Numerics.IMultiplicativeIdentity<BigRational.Integer, BigRational.Integer>
System.Numerics.IMultiplyOperators<BigRational.Integer, BigRational.Integer, BigRational.Integer>
System.Numerics.INumber<BigRational.Integer>
System.Numerics.INumberBase<BigRational.Integer>
System.Numerics.ISubtractionOperators<BigRational.Integer, BigRational.Integer, BigRational.Integer>
System.Numerics.IUnaryNegationOperators<BigRational.Integer, BigRational.Integer>
System.Numerics.IUnaryPlusOperators<BigRational.Integer, BigRational.Integer>
System.Numerics.IShiftOperators<BigRational.Integer, System.Int32, BigRational.Integer>
System.Numerics.ISignedNumber<BigRational.Integer>
Namespace: System.Numerics
Assembly: System.Numerics.Rational.dll
Syntax
public sealed class Integer : ValueType
Remarks

This type of number is compatible with .NET7 System.Numerics.BigInteger, hence all the overhead.
There are additional functions for fast and numerically exact bit-level operations e.g:
Shl(BigRational.Integer, Int32), Shr(BigRational.Integer, Int32), Msb(BigRational.Integer), Lsb(BigRational.Integer) ...
The implementation is currently not yet CPU optimized.

Constructors

Name Description
Integer(Byte[])
Integer(Decimal)
Integer(Double)
Integer(Int128)
Integer(Int32)
Integer(Int64)
Integer(ReadOnlySpan<Byte>, Boolean, Boolean)
Integer(Single)
Integer(UInt128)
Integer(UInt32)
Integer(UInt64)

Properties

Name Description
IsEven
IsOne
IsPowerOfTwo
IsZero
MinusOne
One
Sign
Zero

Methods

Name Description
Abs(BigRational.Integer)
Add(BigRational.Integer, BigRational.Integer)
CompareTo(Int64)
CompareTo(BigRational.Integer)
CompareTo(Object)
CreateChecked<TOther>(TOther)
CreateSaturating<TOther>(TOther)
CreateTruncating<TOther>(TOther)
Divide(BigRational.Integer, BigRational.Integer)
DivRem(BigRational.Integer, BigRational.Integer)
DivRem(BigRational.Integer, BigRational.Integer, out BigRational.Integer)
Equals(Int64)
Equals(BigRational.Integer)
Equals(Object)
GetByteCount(Boolean)
GetHashCode()
GreatestCommonDivisor(BigRational.Integer, BigRational.Integer)

Finds the greatest common divisor (GCD) of two BigRational.Integer integer values.

IsEvenInteger(BigRational.Integer)
IsNegative(BigRational.Integer)
IsOddInteger(BigRational.Integer)
IsPositive(BigRational.Integer)
IsPow2(BigRational.Integer)
LeastCommonMultiple(BigRational, BigRational)

Finds the least common multiple (LCM) of two BigRational.Integer integer values.

Log(BigRational.Integer)
Log(BigRational.Integer, Double)
Log10(BigRational.Integer)
Log2(BigRational.Integer)
Lsb(BigRational.Integer)
Max(BigRational.Integer, BigRational.Integer)
MaxMagnitude(BigRational.Integer, BigRational.Integer)
Min(BigRational.Integer, BigRational.Integer)
MinMagnitude(BigRational.Integer, BigRational.Integer)
ModPow(BigRational.Integer, BigRational.Integer, BigRational.Integer)
Msb(BigRational.Integer)
Multiply(BigRational.Integer, BigRational.Integer)
Negate(BigRational.Integer)
op_UnsignedRightShift(BigRational.Integer, Int32)
Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)
Parse(ReadOnlySpan<Char>, IFormatProvider)
Parse(String)
Parse(String, NumberStyles)
Parse(String, NumberStyles, IFormatProvider)
Parse(String, IFormatProvider)
PopCount(BigRational.Integer)
Pow(BigRational.Integer, Int32)
Remainder(BigRational.Integer, BigRational.Integer)
RotateLeft(BigRational.Integer, Int32)
RotateRight(BigRational.Integer, Int32)
Shl(BigRational.Integer, Int32)
Shr(BigRational.Integer, Int32)
Subtract(BigRational.Integer, BigRational.Integer)
ToByteArray()
ToByteArray(Boolean, Boolean)
ToString()
ToString(String, IFormatProvider)
TrailingZeroCount(BigRational.Integer)
TryFormat(Span<Char>, out Int32, ReadOnlySpan<Char>, IFormatProvider)
TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, out BigRational.Integer)
TryParse(ReadOnlySpan<Char>, IFormatProvider, out BigRational.Integer)
TryParse(String, NumberStyles, IFormatProvider, out BigRational.Integer)
TryParse(String, IFormatProvider, out BigRational.Integer)
TryWriteBytes(Span<Byte>, out Int32, Boolean, Boolean)

Operators

Name Description
Addition(BigRational.Integer, BigRational.Integer)
BitwiseAnd(BigRational.Integer, BigRational.Integer)
BitwiseOr(Nullable<BigRational.Integer>, BigRational.Integer)

Performs a bitwise Or operation on two BigRational.Integer values.

Decrement(BigRational.Integer)
Division(BigRational.Integer, BigRational.Integer)
Equality(BigRational.Integer, Int64)
Equality(BigRational.Integer, BigRational.Integer)
ExclusiveOr(BigRational.Integer, BigRational.Integer)
Explicit(Decimal to BigRational.Integer)
Explicit(Double to BigRational.Integer)
Explicit(Half to BigRational.Integer)
Explicit(BigRational to BigRational.Integer)
Explicit(BigRational.Integer to Byte)
Explicit(BigRational.Integer to Char)
Explicit(BigRational.Integer to Decimal)
Explicit(BigRational.Integer to Double)
Explicit(BigRational.Integer to Half)
Explicit(BigRational.Integer to Int128)
Explicit(BigRational.Integer to Int16)
Explicit(BigRational.Integer to Int32)
Explicit(BigRational.Integer to Int64)
Explicit(BigRational.Integer to IntPtr)
Explicit(BigRational.Integer to BigInteger)
Explicit(BigRational.Integer to Complex)
Explicit(BigRational.Integer to SByte)
Explicit(BigRational.Integer to Single)
Explicit(BigRational.Integer to UInt128)
Explicit(BigRational.Integer to UInt16)
Explicit(BigRational.Integer to UInt32)
Explicit(BigRational.Integer to UInt64)
Explicit(BigRational.Integer to UIntPtr)
Explicit(Complex to BigRational.Integer)
Explicit(Single to BigRational.Integer)
GreaterThan(BigRational.Integer, Int64)
GreaterThan(BigRational.Integer, BigRational.Integer)
GreaterThanOrEqual(BigRational.Integer, Int64)
GreaterThanOrEqual(BigRational.Integer, BigRational.Integer)
Implicit(Byte to BigRational.Integer)
Implicit(Char to BigRational.Integer)
Implicit(Int128 to BigRational.Integer)
Implicit(Int16 to BigRational.Integer)
Implicit(Int32 to Nullable<BigRational.Integer>)
Implicit(Int32 to BigRational.Integer)
Implicit(Int64 to BigRational.Integer)
Implicit(IntPtr to BigRational.Integer)
Implicit(BigInteger to BigRational.Integer)
Implicit(BigRational.Integer to BigRational)
Implicit(SByte to BigRational.Integer)
Implicit(UInt128 to BigRational.Integer)
Implicit(UInt16 to BigRational.Integer)
Implicit(UInt32 to BigRational.Integer)
Implicit(UInt64 to BigRational.Integer)
Implicit(UIntPtr to BigRational.Integer)
Increment(BigRational.Integer)
Inequality(BigRational.Integer, Int64)
Inequality(BigRational.Integer, BigRational.Integer)
LeftShift(BigRational.Integer, Int32)
LessThan(BigRational.Integer, Int64)
LessThan(BigRational.Integer, BigRational.Integer)
LessThanOrEqual(BigRational.Integer, Int64)
LessThanOrEqual(BigRational.Integer, BigRational.Integer)
Modulus(BigRational.Integer, BigRational.Integer)
Multiply(BigRational.Integer, BigRational.Integer)
OnesComplement(BigRational.Integer)
RightShift(BigRational.Integer, Int32)
Subtraction(BigRational.Integer, BigRational.Integer)
UnaryNegation(BigRational.Integer)
UnaryPlus(BigRational.Integer)
In This Article
Back to top Generated by DocFX