C# Class TemporalNetworks.MathHelper

This class provides some simple math helper functions
Mostra file Open project: IngoScholtes/TemporalNetworks

Public Methods

Method 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 method

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

LCM() public static method

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

RoundToMixedFraction() public static method

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
return void