C# Class Reko.Core.Rational

Simplistic implementation of rational numbers.
Afficher le fichier Open project: uxmal/reko Class Usage Examples

Méthodes publiques

Свойство Type Description
Denominator long
Numerator long

Méthodes publiques

Méthode Description
FromDouble ( double x ) : Rational

Use a sequence of continued fractions to find a good rational approximation to the double precition provided number

http://jonisalonen.com/2012/converting-decimal-numbers-to-ratios/

FromIntegers ( long num, long den ) : Rational
Rational ( long num, long den ) : System
Reciprocal ( ) : Rational
ToDouble ( ) : double
ToString ( ) : string
operator ( ) : Rational

Private Methods

Méthode Description
gcd ( long a, long b ) : long

Method Details

FromDouble() public static méthode

Use a sequence of continued fractions to find a good rational approximation to the double precition provided number
http://jonisalonen.com/2012/converting-decimal-numbers-to-ratios/
public static FromDouble ( double x ) : Rational
x double
Résultat Rational

FromIntegers() public static méthode

public static FromIntegers ( long num, long den ) : Rational
num long
den long
Résultat Rational

Rational() public méthode

public Rational ( long num, long den ) : System
num long
den long
Résultat System

Reciprocal() public méthode

public Reciprocal ( ) : Rational
Résultat Rational

ToDouble() public méthode

public ToDouble ( ) : double
Résultat double

ToString() public méthode

public ToString ( ) : string
Résultat string

operator() public static méthode

public static operator ( ) : Rational
Résultat Rational

Property Details

Denominator public_oe property

public long Denominator
Résultat long

Numerator public_oe property

public long Numerator
Résultat long