View source: R/transcNumFracs.r
e2cfrac | R Documentation |
Select a particular formula to get an approximate value for Euler's number or any power e^(x/y)
.
e2cfrac(nterms, pownum = 1, powdenom = 1, method = c('euler','wall','gauss'), ...)
nterms |
How many terms of the continued fraction formula to use. |
pownum |
An integer identifying the numerator of the (possibly fractional) power to raise |
powdenom |
An integer identifying the denominator of the (possibly fractional) power to raise |
method |
Select the method, i.e. the continued fraction formula, for the calculation. If |
... |
Reserved for future use |
The two methods which calculate e
but not to any power, use the following formulas:
"euler" denominators = 2; 1,2,1,1,4,1,1,6,1,1,8,...
"wall" denominators = 2; 1,2,3,4,... and numerators = 1,1,2,3,4,...
The third method, which can calculate powers of e
is variously listed as derived by Euler or proved by Gauss based on hypergeometric functions, is automatically invoked if pownum/powdenom != 1
.
"gauss" denominators = 1; 2y-x,6y,10y,14y, 18y, 22y,.. and numerators = 2x,x^2,x^2,x^2,... where the exponent is x/y .
Due to the cyclic formula for the "euler" case, the exact number of terms used in the calculation may differ from the input nterms
by 1 or 2 counts.
edec
contains the mpfr
extended decimal representation. egmp
contains the fraction representation.
nterms, pownum, powdenom
echo back the input arguments used.
method, nums, denoms
report the actual values used in the calculation.
Carl Witthoft, carl@witthoft.com
https://mathworld.wolfram.com/eContinuedFraction.html https://en.wikipedia.org/wiki/Euler's_continued_fraction_formula https://en.wikipedia.org/wiki/Gauss's_continued_fraction
e2cfrac(nterms = 10)
e2cfrac(nterms = 10, method = 'wall')
e2cfrac(nterms = 10, pownum = 2)
e2cfrac(nterms = 10, powdenom = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.