Function Math.Sum Series Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Overload List
Sum | Adds up the terms of a series. |
Sum | Adds up the terms of a series. |
SumSeries(Func<Int32, Double>, Int32, Double)
Adds up the terms of a series.
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
DoubleThe 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.
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
DoubleThe sum of the elements in terms up to maxTerms terms or the first term within a fraction relativeTolerance of the sum.