BigRational Structure |
[This is preliminary documentation and is subject to change.]
Namespace: NForza.Transit.Numerics
public struct BigRational : IComparable, IComparable<BigRational>, IEquatable<BigRational>
The BigRational type exposes the following members.
Name | Description | |
---|---|---|
![]() | BigRational(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"
|
![]() | BigRational(Double) |
Initializes a new instance of the BigRational struct.
|
![]() | BigRational(BigInteger) |
Initializes a new instance of the BigRational struct.
|
![]() | BigRational(BigInteger, BigInteger) |
Initializes a new instance of the BigRational struct.
|
![]() | BigRational(BigInteger, BigInteger, BigInteger) |
Initializes a new instance of the BigRational struct.
|
Name | Description | |
---|---|---|
![]() ![]() | Abs |
Get the absolute value of the specified r.
|
![]() ![]() | Add |
Adds the specified x and y.
|
![]() ![]() | Compare |
Compares the specified r1.
|
![]() | CompareTo |
Compares the current object with another object of the same type.
|
![]() ![]() | Divide |
Divides the specified dividend.
|
![]() ![]() | DivRem |
Get the remainder of the division.
|
![]() | Equals(Object) |
Indicates whether this instance and a specified object are equal.
(Overrides ValueTypeEquals(Object).) |
![]() | Equals(BigRational) |
Indicates whether the current object is equal to another object of the same type.
a/b = c/d, iff ad = bc
|
![]() | GetFractionPart | 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 |
![]() | GetHashCode |
Returns a hash code for this instance.
(Overrides ValueTypeGetHashCode.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GetWholePart | 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 |
![]() ![]() | Invert |
Inverts the specified r.
|
![]() ![]() | LeastCommonDenominator |
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
|
![]() ![]() | Multiply |
Multiplies the specified x and y.
|
![]() ![]() | Negate |
Negates the specified r.
|
![]() ![]() | Pow |
Gets the powers the specified base value.
|
![]() ![]() | Remainder |
Calculates the remainder.
|
![]() ![]() | Subtract |
Subtracts y from the specified x.
|
![]() | ToString |
Returns the fully qualified type name of this instance.
(Overrides ValueTypeToString.) |
![]() ![]() | TryParse |
Tries to parse.
|
Name | Description | |
---|---|---|
![]() ![]() | Addition |
Implements the operator +.
|
![]() ![]() | Decrement |
Implements the operator --.
|
![]() ![]() | Division |
Implements the operator /.
|
![]() ![]() | Equality |
Implements the operator ==.
|
![]() ![]() | (BigRational to SByte) |
Performs an explicit conversion from BigRational to SByte.
|
![]() ![]() | (BigRational to UInt16) |
Performs an explicit conversion from BigRational to UInt16.
|
![]() ![]() | (BigRational to UInt32) |
Performs an explicit conversion from BigRational to UInt32.
|
![]() ![]() | (BigRational to UInt64) |
Performs an explicit conversion from BigRational to UInt64.
|
![]() ![]() | (BigRational to Byte) |
Performs an explicit conversion from BigRational to Byte.
|
![]() ![]() | (BigRational to Int16) |
Performs an explicit conversion from BigRational to Int16.
|
![]() ![]() | (BigRational to Int32) |
Performs an explicit conversion from BigRational to Int32.
|
![]() ![]() | (BigRational to Int64) |
Performs an explicit conversion from BigRational to Int64.
|
![]() ![]() | (BigRational to BigInteger) |
Performs an explicit conversion from BigRational to BigInteger.
|
![]() ![]() | (BigRational to Single) |
Performs an explicit conversion from BigRational to Single.
|
![]() ![]() | (BigRational to Double) |
Performs an explicit conversion from BigRational to Double.
|
![]() ![]() | (BigRational to Decimal) |
Performs an explicit conversion from BigRational to Decimal.
|
![]() ![]() | GreaterThan |
Implements the operator >.
|
![]() ![]() | GreaterThanOrEqual |
Implements the operator >=.
|
![]() ![]() | (Byte to BigRational) |
Performs an implicit conversion from Byte to BigRational.
|
![]() ![]() | (Decimal to BigRational) |
Performs an implicit conversion from Decimal to BigRational.
|
![]() ![]() | (Double to BigRational) |
Performs an implicit conversion from Double to BigRational.
|
![]() ![]() | (Int16 to BigRational) |
Performs an implicit conversion from Int16 to BigRational.
|
![]() ![]() | (Int32 to BigRational) |
Performs an implicit conversion from Int32 to BigRational.
|
![]() ![]() | (Int64 to BigRational) |
Performs an implicit conversion from Int64 to BigRational.
|
![]() ![]() | (BigInteger to BigRational) |
Performs an implicit conversion from BigInteger to BigRational.
|
![]() ![]() | (SByte to BigRational) |
Performs an implicit conversion from SByte to BigRational.
|
![]() ![]() | (Single to BigRational) |
Performs an implicit conversion from Single to BigRational.
|
![]() ![]() | (UInt16 to BigRational) |
Performs an implicit conversion from UInt16 to BigRational.
|
![]() ![]() | (UInt32 to BigRational) |
Performs an implicit conversion from UInt32 to BigRational.
|
![]() ![]() | (UInt64 to BigRational) |
Performs an implicit conversion from UInt64 to BigRational.
|
![]() ![]() | Increment |
Implements the operator ++.
|
![]() ![]() | Inequality |
Implements the operator !=.
|
![]() ![]() | LessThan |
Implements the operator <.
|
![]() ![]() | LessThanOrEqual |
Implements the operator <=.
|
![]() ![]() | Modulus |
Implements the operator %.
|
![]() ![]() | Multiply |
Implements the operator *.
|
![]() ![]() | Subtraction |
Implements the operator -.
|
![]() ![]() | UnaryNegation |
Implements the operator -.
|
![]() ![]() | UnaryPlus |
Implements the operator +.
|
Name | Description | |
---|---|---|
![]() | Denominator |
Gets the denominator.
|
![]() ![]() | MinusOne |
Gets minus one as a big rational.
|
![]() | Numerator |
Gets the numerator.
|
![]() ![]() | One |
Gets one as a big rational.
|
![]() | Sign |
Gets the sign.
|
![]() ![]() | Zero |
Gets zero as a big rational.
|