Метод | Описание | |
---|---|---|
Duplicate ( ) : |
The function replicates current Fraction object
|
|
Equals ( object obj ) : bool |
checks whether two fractions are equal
|
|
Fraction ( ) : System |
Constructors
|
|
Fraction ( double dDecimalValue ) : System | ||
Fraction ( long iWholeNumber ) : System | ||
Fraction ( long iNumerator, long iDenominator ) : System | ||
Fraction ( string strValue ) : System | ||
GetHashCode ( ) : int |
returns a hash code for this fraction
|
|
Inverse ( |
The function returns the inverse of a Fraction object
|
|
ReduceFraction ( Fraction frac ) : void |
The function reduces(simplifies) a Fraction object by dividing both its numerator and denominator by their GCD
|
|
ToDouble ( ) : double |
The function returns the current Fraction object as double
|
|
ToDouble ( Fraction frac ) : double |
The function takes a Fraction object and returns its value as double
|
|
ToFraction ( double dValue ) : Fraction |
The function takes a floating point number as an argument and returns its corresponding reduced fraction
|
|
ToFraction ( string strValue ) : Fraction |
The function takes an string as an argument and returns its corresponding reduced fraction the string can be an in the form of and integer, double or fraction. e.g it can be like "123" or "123.321" or "123/456"
|
|
ToString ( ) : string |
The function returns the current Fraction object as a string
|
|
operator ( ) : Fraction | ||
operator ( ) : bool |
Метод | Описание | |
---|---|---|
Add ( |
internal functions for binary operations
|
|
GCD ( long iNo1, long iNo2 ) : long |
The function returns GCD of two numbers (used for reducing a Fraction)
|
|
Initialize ( long iNumerator, long iDenominator ) : void |
Internal function for constructors
|
|
Multiply ( |
||
Negate ( Fraction frac1 ) : Fraction |
internal function for negation
|
public Fraction ( double dDecimalValue ) : System | ||
dDecimalValue | double | |
Результат | System |
public Fraction ( long iWholeNumber ) : System | ||
iWholeNumber | long | |
Результат | System |
public Fraction ( long iNumerator, long iDenominator ) : System | ||
iNumerator | long | |
iDenominator | long | |
Результат | System |
public Fraction ( string strValue ) : System | ||
strValue | string | |
Результат | System |
public static Inverse ( |
||
frac1 | ||
Результат |
public static ReduceFraction ( Fraction frac ) : void | ||
frac | Fraction | |
Результат | void |
public static ToDouble ( Fraction frac ) : double | ||
frac | Fraction | |
Результат | double |
public static ToFraction ( double dValue ) : Fraction | ||
dValue | double | |
Результат | Fraction |
public static ToFraction ( string strValue ) : Fraction | ||
strValue | string | |
Результат | Fraction |