static IEnumerable<Fraction> Sequence(Fraction f) { while (true) { Fraction result = new Fraction(1) + new Fraction(1, (new Fraction(1) + f)); yield return result; f = result; } }
public Fraction(BigInteger n, Fraction d) : this(n * d.d, d.n) { }
public void TestDigitCount() { Fraction f = new Fraction(17,1713); Assert.AreEqual(2U, f.NumeratorDigits()); Assert.AreEqual(4U, f.DenominatorDigits()); }
private static bool Matches(Fraction f) { return f.NumeratorDigits() > f.DenominatorDigits(); }
public bool Equals(Fraction other) { return(num == other.num && den == other.den); }