Computes the sum of an expression evaluated over the specified range.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static double Sum(
Func<int, double> terms,
int lowerBound,
int upperBound
)
Public Shared Function Sum (
terms As Func(Of Integer, Double),
lowerBound As Integer,
upperBound As Integer
) As Double
public:
static double Sum(
Func<int, double>^ terms,
int lowerBound,
int upperBound
)
static member Sum :
terms : Func<int, float> *
lowerBound : int *
upperBound : int -> float
Parameters
- terms
- Type: SystemFuncInt32, Double
A delegate that returns the value of the specified term. - lowerBound
- Type: SystemInt32
The (inclusive) lower bound of the summation. - upperBound
- Type: SystemInt32
The (exclusive) upper bound of the summation.
Return Value
Type:
DoubleThe sum of
terms evaluated at all integers from
lowerBound up to but not including
upperBound.
Reference