C# Class TemporalNetworks.MathHelper

This class provides some simple math helper functions
Afficher le fichier Open project: IngoScholtes/TemporalNetworks

Méthodes publiques

Méthode Description
GCD ( int a, int b ) : int

Returns the greatest common divisor of two numbers

LCM ( int a, int b ) : int

Returns the least common multiple of two numbers

RoundToMixedFraction ( double input, int accuracy, int &whole, int &numerator, int &denominator ) : void

Computes a mixed fraction representation of a double, like e.g. 5 + 1/2 for 5.5.

Method Details

GCD() public static méthode

Returns the greatest common divisor of two numbers
public static GCD ( int a, int b ) : int
a int
b int
Résultat int

LCM() public static méthode

Returns the least common multiple of two numbers
public static LCM ( int a, int b ) : int
a int
b int
Résultat int

RoundToMixedFraction() public static méthode

Computes a mixed fraction representation of a double, like e.g. 5 + 1/2 for 5.5.
public static RoundToMixedFraction ( double input, int accuracy, int &whole, int &numerator, int &denominator ) : void
input double The double to compute a mixed fraction for
accuracy int The accuracy of the rounding
whole int An out parameter containing the whole part
numerator int An out parameter containing the numerator of the fractional part
denominator int An out parameter containing the denominator of the fractional part
Résultat void