[]
        
(Showing Draft Content)

C1.Framework.Mathematics.Fraction-1

Fraction<T> Struct

Represents nn expression that indicates the quotient of two quantities.

Namespace: C1.Framework.Mathematics
Assembly: C1.Win.Input.8.dll
Syntax
public struct Fraction<T>
Type Parameters
Name Description
T

Indicate the type of numerator and denominator.

Constructors

Name Description
Fraction(T)

Initializes a new instance of Fraction<T> structure with the specified numerator and denominator.

Fraction(T, T)

Initializes a new instance of Fraction<T> structure with the specified numerator and denominator.

Properties

Name Description
Denominator

Gets or sets the denominator of the fraction.

Numerator

Gets or sets the numertor of the fraction.

Methods

Name Description
Reverse(Fraction<T>)

Reverse the fraction.

Simplify()

Simplify the fraction.

Operators

Name Description
operator +(Fraction<T>, Fraction<T>)

Defines the binary "+" operator.

operator /(Fraction<T>, Fraction<T>)

Defines the binary "/" operator.

operator /(Fraction<T>, T)

Defines the binary "/" operator.

operator /(T, Fraction<T>)

Defines the binary "/" operator.

explicit operator Fraction<T>(double)

Converts the double to fraction.

explicit operator Fraction<T>(float)

Converts the float to fraction.

implicit operator double(Fraction<T>)

Converts the fraction to double.

implicit operator float(Fraction<T>)

Converts the fraction to float.

operator !(Fraction<T>)

Defines the "!" operator. Note: "!" is used as simplify in here.

operator *(Fraction<T>, Fraction<T>)

Defines the binary "*" operator.

operator *(Fraction<T>, T)

Defines the binary "*" operator.

operator *(T, Fraction<T>)

Defines the binary "*" operator.

operator -(Fraction<T>, Fraction<T>)

Defines the binary "-" operator.

operator -(Fraction<T>)

Defines the unary "-" operator.