Adds up the terms of a series.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static double SumSeries(
IEnumerable<double> terms,
int maxTerms,
double relativeTolerance = 2.22044604925031E-16
)
Public Shared Function SumSeries (
terms As IEnumerable(Of Double),
maxTerms As Integer,
Optional relativeTolerance As Double = 2.22044604925031E-16
) As Double
public:
static double SumSeries(
IEnumerable<double>^ terms,
int maxTerms,
double relativeTolerance = 2.22044604925031E-16
)
static member SumSeries :
terms : IEnumerable<float> *
maxTerms : int *
?relativeTolerance : float
(* Defaults:
let _relativeTolerance = defaultArg relativeTolerance 2.22044604925031E-16
*)
-> float
Parameters
- terms
- Type: System.Collections.GenericIEnumerableDouble
A sequence of real numbers. - maxTerms
- Type: SystemInt32
The maximum number of terms to include in the summation. - relativeTolerance (Optional)
- Type: SystemDouble
The relative size of the smallest terms to include in the summation.
Return Value
Type:
DoubleThe sum of the elements in
terms up to
maxTerms terms or the first term within
a fraction
relativeTolerance of the sum.
Reference