C# Class MonoTouch.Dialog.Extensions.Fraction

Afficher le fichier Open project: SuperYeti/MonoTouch.Dialog.Extensions Class Usage Examples

Méthodes publiques

Méthode Description
Duplicate ( ) : Fraction

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 ( Fraction frac1 ) : Fraction

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

ToDecimal ( ) : decimal

The function returns the current Fraction object as decimal

ToDouble ( ) : double

The function returns the current Fraction object as double

ToFraction ( decimal dValue ) : Fraction
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

Operators for the Fraction object includes -(unary), and binary opertors such as +,-,*,/ also includes relational and logical operators such as ==,!=,<,>,<=,>=

operator ( ) : bool

Private Methods

Méthode Description
Add ( Fraction frac1, Fraction frac2 ) : Fraction

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 ( Fraction frac1, Fraction frac2 ) : Fraction
Negate ( Fraction frac1 ) : Fraction

internal function for negation

Method Details

Duplicate() public méthode

The function replicates current Fraction object
public Duplicate ( ) : Fraction
Résultat Fraction

Equals() public méthode

checks whether two fractions are equal
public Equals ( object obj ) : bool
obj object
Résultat bool

Fraction() public méthode

Constructors
public Fraction ( ) : System
Résultat System

Fraction() public méthode

public Fraction ( double dDecimalValue ) : System
dDecimalValue double
Résultat System

Fraction() public méthode

public Fraction ( long iWholeNumber ) : System
iWholeNumber long
Résultat System

Fraction() public méthode

public Fraction ( long iNumerator, long iDenominator ) : System
iNumerator long
iDenominator long
Résultat System

Fraction() public méthode

public Fraction ( string strValue ) : System
strValue string
Résultat System

GetHashCode() public méthode

returns a hash code for this fraction
public GetHashCode ( ) : int
Résultat int

Inverse() public static méthode

The function returns the inverse of a Fraction object
public static Inverse ( Fraction frac1 ) : Fraction
frac1 Fraction
Résultat Fraction

ReduceFraction() public static méthode

The function reduces(simplifies) a Fraction object by dividing both its numerator and denominator by their GCD
public static ReduceFraction ( Fraction frac ) : void
frac Fraction
Résultat void

ToDecimal() public méthode

The function returns the current Fraction object as decimal
public ToDecimal ( ) : decimal
Résultat decimal

ToDouble() public méthode

The function returns the current Fraction object as double
public ToDouble ( ) : double
Résultat double

ToFraction() public static méthode

public static ToFraction ( decimal dValue ) : Fraction
dValue decimal
Résultat Fraction

ToFraction() public static méthode

The function takes a floating point number as an argument and returns its corresponding reduced fraction
public static ToFraction ( double dValue ) : Fraction
dValue double
Résultat Fraction

ToFraction() public static méthode

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"
public static ToFraction ( string strValue ) : Fraction
strValue string
Résultat Fraction

ToString() public méthode

The function returns the current Fraction object as a string
public ToString ( ) : string
Résultat string

operator() public static méthode

Operators for the Fraction object includes -(unary), and binary opertors such as +,-,*,/ also includes relational and logical operators such as ==,!=,<,>,<=,>=
public static operator ( ) : Fraction
Résultat Fraction

operator() public static méthode

public static operator ( ) : bool
Résultat bool