real.py

ExponentialPowerSeries class

A class for exponential power serieses, whose n-th term has form:

a_n * x ** n / n!

constructor

ExponentialPowerSeries(iterator)

Construct an exponential power series with coefficient generated by the given iterator, which can be an infinite iterator.

methods

terms(x)

Generator of terms of series with assigned x value.

operator

(x, maxerror)

Return the value of the series with x assigned. The maximum error maxerror must be given as a RelativeError or AbsoluteError instance.

>>> expo = ExponentialPowerSeries(itertools.cycle([1]))
>>> expo(.5, defaultError)
Rational(5434422938503507, 3296144130048000)

Last-modified: 2005-10-26 (¿å) 13:28:35