[]
Represents nn expression that indicates the quotient of two quantities.
public struct Fraction<T>
Name | Description |
---|---|
T | Indicate the type of numerator and denominator. |
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. |
Name | Description |
---|---|
Denominator | Gets or sets the denominator of the fraction. |
Numerator | Gets or sets the numertor of the fraction. |
Name | Description |
---|---|
Reverse(Fraction<T>) | Reverse the fraction. |
Simplify() | Simplify the fraction. |
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. |