Function Math.Sum(Func<Int 32, Double>, Int 32, Int 32) Method
Computes the sum of an expression evaluated over the specified range.
Definition
Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
The sum of terms evaluated at all integers from lowerBound up to but not including upperBound.
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
public static double Sum(
Func<int, double> terms,
int lowerBound,
int upperBound
)
Parameters
- terms Func<Int32, Double>
- A delegate that returns the value of the specified term.
- lowerBound Int32
- The (inclusive) lower bound of the summation.
- upperBound Int32
- The (exclusive) upper bound of the summation.
Return Value
DoubleThe sum of terms evaluated at all integers from lowerBound up to but not including upperBound.
Exceptions
Argument | terms is null. |