Navigation
Synopsis Sum the elements of a set.
Function num sum(set[num] s)
Usage import Set;
Examples
rascal>import Set;
ok
rascal>sum({3, 1, 4, 5});
num: 13
rascal>sum({3, 1.5, 4, 5});
num: 13.5

Questions
Question [1].
The type of sum({17.6212478032325320, -11.03768989024501920, 1, 16}) is

Question [2].
sum({5, -20, 7, 16, 8, 14, -12}) == 



Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.