C# 클래스 TemporalNetworks.MathHelper

This class provides some simple math helper functions
파일 보기 프로젝트 열기: IngoScholtes/TemporalNetworks

공개 메소드들

메소드 설명
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.

메소드 상세

GCD() 공개 정적인 메소드

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

LCM() 공개 정적인 메소드

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

RoundToMixedFraction() 공개 정적인 메소드

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
리턴 void