public void AddBoundingFractions(int denominator) { var boundingFractions = Fraction.GetBoundingFractions(DecimalValue, denominator); HighSideApproximationList.Add(new FractionApproximation(DecimalValue, boundingFractions.Item1)); LowSideApproximationList.Add(new FractionApproximation(DecimalValue, boundingFractions.Item2)); }
public void AddFraction(Fraction f) { var d = f.ToDecimal(); if (d == DecimalValue) { ExactFraction = f; } else if (d > DecimalValue) { HighSideApproximationList.Add(new FractionApproximation(DecimalValue, f)); } else { LowSideApproximationList.Add(new FractionApproximation(DecimalValue, f)); } }