TFraction Class

Implementation of BaseEntry as a fraction.

Definition

Namespace: SMath.Math.Numeric
Assembly: SMath.Math.Numeric (in SMath.Math.Numeric.dll) Version: 1.73.9126.0
C#
public sealed class TFraction : BaseEntry
Inheritance
Object    BaseEntry    TFraction

Constructors

TFraction(Double) Constructs TFraction instance from the specified Double value.
TFraction(Double, Double)

Constructs TFraction instance with the specified numerator and denominator.

Unless num is zero, reduces the fraction during construction.

TFraction(TDouble, TDouble)

Constructs TFraction instance with the specified numerator and denominator.

Unless num is zero, reduces the fraction during construction.

TFraction(Double, Double, Boolean) Constructs TFraction instance with the specified numerator and denominator.
Obsolete.

Properties

HasUnits Determines whether current instance of BaseEntry contains units or not.
(Inherited from BaseEntry)
IzZero Determines whether current instance of BaseEntry is equal to zero or not.
(Overrides BaseEntry.IzZero)
Type Type of the BaseEntry which is implemented by a current instance of the object.
(Inherited from BaseEntry)
Units

Units of measurement for the expression component.

  Important

Every numeric expression component must have a value in Units. For dimensionless quantities like angles in radians the value of Units is set to 1.


(Inherited from BaseEntry)

Methods

Clone Creates a copy of this instance.
(Overrides BaseEntry.Clone())
Com Adds value to this instance.
(Overrides BaseEntry.Com(BaseEntry))
Cos Computes cosine of this instance.
(Inherited from BaseEntry)
Cot Computes cotangent of this instance.
(Inherited from BaseEntry)
Div Divides this instance by value.
(Overrides BaseEntry.Div(BaseEntry))
EqualsDetermines whether the specified object is equal to the current object.
(Overrides Object.Equals(Object))
GetHashCodeServes as the default hash function.
(Overrides Object.GetHashCode())
GetTypeGets the Type of the current instance.
(Inherited from Object)
Gt Returns true if this instance is greater than value.
(Overrides BaseEntry.Gt(BaseEntry))
Lt Returns true if this instance is less than value.
(Overrides BaseEntry.Lt(BaseEntry))
Mul Multiplies value by this instance.
(Overrides BaseEntry.Mul(BaseEntry))
Pow Exponentiation operation.
(Overrides BaseEntry.Pow(BaseEntry))
Power(TDouble) Computes exponent with base equal to this and power equal to value.
Power(TFraction) Computes exponent with base equal to this and power equal to value.
Round(BaseEntry) Rounds the value to the specified number of fractional digits.
(Inherited from BaseEntry)
Round(BaseEntry, TDouble) Rounds the value to the specified number of fractional digits using the specified rounding convention.
(Inherited from BaseEntry)
Sin Computes sine of this instance.
(Inherited from BaseEntry)
Sub Subtracts value from this instance.
(Overrides BaseEntry.Sub(BaseEntry))
Tan Computes tangent of this instance.
(Inherited from BaseEntry)
ToDouble Converts this instance to a Double value.
(Overrides BaseEntry.ToDouble())
ToString() Converts math expression component to string.
(Inherited from BaseEntry)
ToString(IResultOptions) Converts math expression component to string with options.
(Overrides BaseEntry.ToString(IResultOptions))
ToString(Int32, Int32, FractionsType, Boolean) Converts math expression component to string with options.
(Inherited from BaseEntry)
Obsolete.
ToString(Int32, Int32, FractionsType, Boolean, Boolean, MidpointRounding) Converts math expression component to string with options.
(Inherited from BaseEntry)
Obsolete.
ToTerms() Converts current expression component to the array of Term in reverse Polish notation (RPN).
(Inherited from BaseEntry)
ToTerms(IResultOptions) Converts current expression component to the array of Term in reverse Polish notation (RPN) with options.
(Inherited from BaseEntry)
ToTerms(Int32, Int32, FractionsType, Boolean) Converts current expression component to the array of Term in reverse Polish notation (RPN) with options.
(Inherited from BaseEntry)
Obsolete.
ToTerms(Int32, Int32, FractionsType, Boolean, Boolean, MidpointRounding) Converts current expression component to the array of Term in reverse Polish notation (RPN) with options.
(Inherited from BaseEntry)
Obsolete.
Trunc Returns the integer part of this value.
(Inherited from BaseEntry)

Operators

Addition(TDouble, TFraction) Adds TFraction object to TDouble object.
Addition(TFraction, TDouble) Adds TDouble object to TFraction object.
Addition(TFraction, TFraction) Adds two TFraction objects.
Division(TDouble, TFraction) Divides TDouble object by TFraction object.
Division(TFraction, TDouble) Divides TFraction object by TDouble object.
Division(TFraction, TFraction) Divides two TFraction objects.
Equality(TFraction, TFraction) Returns true if the operands are equal.
GreaterThan(TFraction, TFraction) Returns true if left-hand operand is greater than right-hand operand.
Inequality(TFraction, TFraction) Returns true if the operands are not equal.
LessThan(TFraction, TFraction) Returns true if left-hand operand is less than right-hand operand.
Multiply(TDouble, TFraction) Multiplies TFraction object by TDouble object.
Multiply(TFraction, TDouble) Multiplies TDouble object by TFraction object.
Multiply(TFraction, TFraction) Multiplies two TFraction objects.
Subtraction(TDouble, TFraction) Subtracts TFraction object from TDouble object.
Subtraction(TFraction, TDouble) Subtracts TDouble object from TFraction object.
Subtraction(TFraction, TFraction) Subtracts two TFraction objects.

Fields

den Denominator of the fraction.
num Numerator of the fraction.

See Also