Click or drag to resize
BigRational Structure

[This is preliminary documentation and is subject to change.]

Represents a rational with infinite precision.

Namespace: NForza.Transit.Numerics
Assembly: Transit (in Transit.dll) Version: 0.8.1-alpha
Syntax
C#
public struct BigRational : IComparable, 
	IComparable<BigRational>, IEquatable<BigRational>

The BigRational type exposes the following members.

Constructors
  NameDescription
Public methodBigRational(Decimal)
Initializes a new instance of the BigRational struct. The Decimal type represents floating point numbers exactly, with no rounding error. Values such as "0.1" in Decimal are actually representable, and convert cleanly to BigRational as "11/10"
Public methodBigRational(Double)
Initializes a new instance of the BigRational struct.
Public methodBigRational(BigInteger)
Initializes a new instance of the BigRational struct.
Public methodBigRational(BigInteger, BigInteger)
Initializes a new instance of the BigRational struct.
Public methodBigRational(BigInteger, BigInteger, BigInteger)
Initializes a new instance of the BigRational struct.
Top
Methods
  NameDescription
Public methodStatic memberAbs
Get the absolute value of the specified r.
Public methodStatic memberAdd
Adds the specified x and y.
Public methodStatic memberCompare
Compares the specified r1.
Public methodCompareTo
Compares the current object with another object of the same type.
Public methodStatic memberDivide
Divides the specified dividend.
Public methodStatic memberDivRem
Get the remainder of the division.
Public methodEquals(Object)
Indicates whether this instance and a specified object are equal.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(BigRational)
Indicates whether the current object is equal to another object of the same type. a/b = c/d, iff ad = bc
Public methodGetFractionPart
GetWholePart() and GetFractionPart()
BigRational == Whole, Fraction
0/2        ==     0,  0/2
1/2        ==     0,  1/2
-1/2        ==     0, -1/2
1/1        ==     1,  0/1
-1/1        ==    -1,  0/1
-3/2        ==    -1, -1/2
3/2        ==     1,  1/2
Public methodGetHashCode
Returns a hash code for this instance.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetWholePart
GetWholePart() and GetFractionPart()
BigRational == Whole, Fraction
0/2        ==     0,  0/2
1/2        ==     0,  1/2
-1/2        ==     0, -1/2
1/1        ==     1,  0/1
-1/1        ==    -1,  0/1
-3/2        ==    -1, -1/2
3/2        ==     1,  1/2
Public methodStatic memberInvert
Inverts the specified r.
Public methodStatic memberLeastCommonDenominator
Least Common Denominator (LCD) The LCD is the least common multiple of the two denominators. For instance, the LCD of {1/2, 1/4} is 4 because the least common multiple of 2 and 4 is 4. Likewise, the LCD of {1/2, 1/3} is 6. To find the LCD: 1) Find the Greatest Common Divisor (GCD) of the denominators 2) Multiply the denominators together 3) Divide the product of the denominators by the GCD
Public methodStatic memberMultiply
Multiplies the specified x and y.
Public methodStatic memberNegate
Negates the specified r.
Public methodStatic memberPow
Gets the powers the specified base value.
Public methodStatic memberRemainder
Calculates the remainder.
Public methodStatic memberSubtract
Subtracts y from the specified x.
Public methodToString
Returns the fully qualified type name of this instance.
(Overrides ValueTypeToString.)
Public methodStatic memberTryParse
Tries to parse.
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Implements the operator +.
Public operatorStatic memberDecrement
Implements the operator --.
Public operatorStatic memberDivision
Implements the operator /.
Public operatorStatic memberEquality
Implements the operator ==.
Public operatorStatic member(BigRational to SByte)
Performs an explicit conversion from BigRational to SByte.
Public operatorStatic member(BigRational to UInt16)
Performs an explicit conversion from BigRational to UInt16.
Public operatorStatic member(BigRational to UInt32)
Performs an explicit conversion from BigRational to UInt32.
Public operatorStatic member(BigRational to UInt64)
Performs an explicit conversion from BigRational to UInt64.
Public operatorStatic member(BigRational to Byte)
Performs an explicit conversion from BigRational to Byte.
Public operatorStatic member(BigRational to Int16)
Performs an explicit conversion from BigRational to Int16.
Public operatorStatic member(BigRational to Int32)
Performs an explicit conversion from BigRational to Int32.
Public operatorStatic member(BigRational to Int64)
Performs an explicit conversion from BigRational to Int64.
Public operatorStatic member(BigRational to BigInteger)
Performs an explicit conversion from BigRational to BigInteger.
Public operatorStatic member(BigRational to Single)
Performs an explicit conversion from BigRational to Single.
Public operatorStatic member(BigRational to Double)
Performs an explicit conversion from BigRational to Double.
Public operatorStatic member(BigRational to Decimal)
Performs an explicit conversion from BigRational to Decimal.
Public operatorStatic memberGreaterThan
Implements the operator >.
Public operatorStatic memberGreaterThanOrEqual
Implements the operator >=.
Public operatorStatic member(Byte to BigRational)
Performs an implicit conversion from Byte to BigRational.
Public operatorStatic member(Decimal to BigRational)
Performs an implicit conversion from Decimal to BigRational.
Public operatorStatic member(Double to BigRational)
Performs an implicit conversion from Double to BigRational.
Public operatorStatic member(Int16 to BigRational)
Performs an implicit conversion from Int16 to BigRational.
Public operatorStatic member(Int32 to BigRational)
Performs an implicit conversion from Int32 to BigRational.
Public operatorStatic member(Int64 to BigRational)
Performs an implicit conversion from Int64 to BigRational.
Public operatorStatic member(BigInteger to BigRational)
Performs an implicit conversion from BigInteger to BigRational.
Public operatorStatic member(SByte to BigRational)
Performs an implicit conversion from SByte to BigRational.
Public operatorStatic member(Single to BigRational)
Performs an implicit conversion from Single to BigRational.
Public operatorStatic member(UInt16 to BigRational)
Performs an implicit conversion from UInt16 to BigRational.
Public operatorStatic member(UInt32 to BigRational)
Performs an implicit conversion from UInt32 to BigRational.
Public operatorStatic member(UInt64 to BigRational)
Performs an implicit conversion from UInt64 to BigRational.
Public operatorStatic memberIncrement
Implements the operator ++.
Public operatorStatic memberInequality
Implements the operator !=.
Public operatorStatic memberLessThan
Implements the operator <.
Public operatorStatic memberLessThanOrEqual
Implements the operator <=.
Public operatorStatic memberModulus
Implements the operator %.
Public operatorStatic memberMultiply
Implements the operator *.
Public operatorStatic memberSubtraction
Implements the operator -.
Public operatorStatic memberUnaryNegation
Implements the operator -.
Public operatorStatic memberUnaryPlus
Implements the operator +.
Top
Properties
  NameDescription
Public propertyDenominator
Gets the denominator.
Public propertyStatic memberMinusOne
Gets minus one as a big rational.
Public propertyNumerator
Gets the numerator.
Public propertyStatic memberOne
Gets one as a big rational.
Public propertySign
Gets the sign.
Public propertyStatic memberZero
Gets zero as a big rational.
Top
See Also