The function f(n)
to calculate the sum.
The upper limit for the sum.
The lower limit for the sum. Defaults to 0
. The order is reversed because a
is optional. Deal with it.
Optional
epsilon: DecimalSourceThe maximum error tolerance, geometrically. Defaults to DEFAULT_TOLERANCE. Only used if b - a
is less than or equal to DEFAULT_ITERATIONS.
Optional
iterations: numberThe amount of iterations to perform. Defaults to DEFAULT_ITERATIONS. Only used if b - a
is greater than DEFAULT_ITERATIONS.
f(n)
, as a Decimal.
Calculates the sum of
f(n)
froma
tob
using either the trapezoidal rule or a basic loop depending on the size ofb - a
.