/// <summary> /// Calculates the remaining portion of the number after A /// 1/(B+(1/(C+(1/(.../newCandidate))))) /// </summary> private double WartośćUłamka(int newCandidate) { double wartośćBieżąca = 1 / (double)newCandidate; foreach (var Bx in SekwencjaUłamkaCiągłego.ToArray().Reverse()) { wartośćBieżąca = 1 / (Bx + wartośćBieżąca); } return(wartośćBieżąca); }
/// <summary> /// Calculates the remaining portion of the number after A /// 1/(B+(1/(C+(1/(...))))) /// </summary> private double WartośćUłamka() { if (SekwencjaUłamkaCiągłego.Count == 0) { return(0); } double current = 0; foreach (var Bx in SekwencjaUłamkaCiągłego.ToArray().Reverse()) { current = 1 / (Bx + current); } return(current); }