sum

Sums elements of r, which must be a finite iterable.

A seed may be passed to sum. Not only will this seed be used as an initial value, but its type will be used if it is not specified.

Note that these specialized summing algorithms execute more primitive operations than vanilla summation. Therefore, if in certain cases maximum speed is required at expense of precision, one can use Summation.fast.

  1. sumType!Range sum(Range r)
    template sum(Summation summation = Summation.appropriate)
    sumType!Range
    sum
    (
    Range
    )
    (
    Range r
    )
    if (
    isIterable!Range
    )
  2. F sum(Range r, F seed)
  3. sumType!T sum(T[] ar)
  4. template sum(F, Summation summation = Summation.appropriate)
  5. template sum(F, string summation)
  6. template sum(string summation)

Members

Functions

sum
sumType!Range sum(Range r)
sum
F sum(Range r, F seed)
sum
sumType!T sum(T[] ar)

Return Value

The sum of all the elements in the range r.

Meta