C# 클래스 Utilities.DataTypes.Fraction

Represents a fraction
파일 보기 프로젝트 열기: JaCraig/Craig-s-Utility-Library 1 사용 예제들

공개 메소드들

메소드 설명
Equals ( object obj ) : bool

Determines if the fractions are equal

Fraction ( decimal Numerator, decimal Denominator ) : System

Constructor

Fraction ( double Numerator, double Denominator ) : System

Constructor

Fraction ( float Numerator, float Denominator ) : System

Constructor

Fraction ( int Numerator, int Denominator ) : System

Constructor

GetHashCode ( ) : int

Gets the hash code of the fraction

Inverse ( ) : Fraction

Returns the inverse of the fraction

Reduce ( ) : void

Reduces the fraction (finds the greatest common denominator and divides the numerator/denominator by it).

ToString ( ) : string

Displays the fraction as a string

operator ( ) : Fraction

Multiplication

operator ( ) : bool

Not equals operator

메소드 상세

Equals() 공개 메소드

Determines if the fractions are equal
public Equals ( object obj ) : bool
obj object object to check
리턴 bool

Fraction() 공개 메소드

Constructor
public Fraction ( decimal Numerator, decimal Denominator ) : System
Numerator decimal Numerator
Denominator decimal Denominator
리턴 System

Fraction() 공개 메소드

Constructor
public Fraction ( double Numerator, double Denominator ) : System
Numerator double Numerator
Denominator double Denominator
리턴 System

Fraction() 공개 메소드

Constructor
public Fraction ( float Numerator, float Denominator ) : System
Numerator float Numerator
Denominator float Denominator
리턴 System

Fraction() 공개 메소드

Constructor
public Fraction ( int Numerator, int Denominator ) : System
Numerator int Numerator
Denominator int Denominator
리턴 System

GetHashCode() 공개 메소드

Gets the hash code of the fraction
public GetHashCode ( ) : int
리턴 int

Inverse() 공개 메소드

Returns the inverse of the fraction
public Inverse ( ) : Fraction
리턴 Fraction

Reduce() 공개 메소드

Reduces the fraction (finds the greatest common denominator and divides the numerator/denominator by it).
public Reduce ( ) : void
리턴 void

ToString() 공개 메소드

Displays the fraction as a string
public ToString ( ) : string
리턴 string

operator() 공개 정적인 메소드

Multiplication
public static operator ( ) : Fraction
리턴 Fraction

operator() 공개 정적인 메소드

Not equals operator
public static operator ( ) : bool
리턴 bool