FunctionMath.SumSeries Method

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

SumSeries(Func<Int32, Double>, Int32, Double) Adds up the terms of a series.
SumSeries(IEnumerable<Double>, Int32, Double) Adds up the terms of a series.

SumSeries(Func<Int32, Double>, Int32, Double)

Adds up the terms of a series.
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.

SumSeries(IEnumerable<Double>, Int32, Double)

Adds up the terms of a series.
C#
public static double SumSeries(
	IEnumerable<double> terms,
	int maxTerms,
	double relativeTolerance = 2.22044604925031E-16
)

Parameters

terms  IEnumerable<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