C# Class StopGuessing.DataStructures.Proportion

A class representing a proportion, or fraction, of numerator over denominator. This comes in handy when one might care about the actual magnitude of the numerator/denominator, which is list in a representation that divides the numerator by the denominator.
ファイルを表示 Open project: Microsoft/StopGuessing Class Usage Examples

Public Methods

Method Description
GetLargest ( IEnumerable proportions ) : Proportion
MinDenominator ( ulong minDenominator ) : Proportion

Return this proportion modified to have a denominator at least as large as a value specified in the parameter.

Proportion ( ulong numerator, ulong denominator ) : System.Collections.Generic

Method Details

GetLargest() public static method

public static GetLargest ( IEnumerable proportions ) : Proportion
proportions IEnumerable
return Proportion

MinDenominator() public method

Return this proportion modified to have a denominator at least as large as a value specified in the parameter.
public MinDenominator ( ulong minDenominator ) : Proportion
minDenominator ulong The denominator to use if the proportions denominator is less than this value.
return Proportion

Proportion() public method

public Proportion ( ulong numerator, ulong denominator ) : System.Collections.Generic
numerator ulong
denominator ulong
return System.Collections.Generic