function returning terms of continued fraction expansion
function options
value of continued fraction
// Continued fraction for (e-1)^(-1):
var gen = generator();
var out = continuedFraction( gen );
// returns ~0.582
function* generator() {
var i = 0;
while ( true ) {
i++;
yield [ i, i ];
}
}
Evaluates the continued fraction approximation for the supplied series generator using the modified Lentz algorithm.
References