FunctionMath.SumSeries(Func<Int32, Double>, Int32, Double) Method

Adds up the terms of a series.

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public static double SumSeries(
	Func<int, double> terms,
	int maxTerms,
	double relativeTolerance = 2.22044604925031E-16
)

Parameters

terms  Func<Int32, Double>
A sequence of real numbers.
maxTerms  Int32
The maximum number of terms to include in the summation.
relativeTolerance  Double  (Optional)
The relative size of the smallest terms to include in the summation.

Return Value

Double
The sum of the elements in terms up to maxTerms terms or the first term within a fraction relativeTolerance of the sum.

See Also