Navigation
Synopsis Sum the elements of a list.
Function num sum(list[num] l)
Usage import List;
Examples
rascal>import List;
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([16, 13.3452476889635080]) is

Question [2].
sum([-18, -3]) == 



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.