AngouriMath

Navigation

← Back to list of members

SumAll​(System.​Collections.​Generic.​IEnumerable{AngouriMath.​Entity})

 Method (no overloads)

Summary

Sums all the given terms and returns the resulting expression
new Entity[]{ 1, 2, 3 }.SumAll() -> "1 + 2 + 3"

Example

The terms are hung into one expression, not added up:
Console.WriteLine(new Entity[] { 1, 2, 3, 4 }.SumAll());
Console.WriteLine(new Entity[] { 1, 2, 3, 4 }.SumAll().Evaled);

Prints
1 + 2 + 3 + 4
10

Remarks

The empty sum is 0, which is what makes
xs.Concat(ys).SumAll() == xs.SumAll() + ys.SumAll() hold for every pair
including the empty one. It used to reach MultiHangBinary's genuine
precondition and throw an AngouriBugException — whose message asks the caller
to report a bug against this repository, for a list their own Where happened
to filter to nothing.
#1028

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online