sum (List, optional Startindex, optional endindex)
This function is designed to return the sum of a list of values or the sum of a range in a list of values.
sum(List) → number This function designed to calculate the sum of a list of numeric values or elements.
sum(List of list, start index, end index) → number This function designed to calculate the sum of the values between given indices in a list of numeric values or elements.
Example:
<br><O N="sumObject1" T="Project" Category="Functions" TransAlignRule="1"><br> <!-- created by ParamML Examples on 8/22/2023 --><br> <P N="List1" V="[0,1,2,3,4,5,6,7,8,9]" /><br> <P N="sumList" V="sum(List1)" /><br> <P N="sumRangeList" V="sum(List1,5,6)" /><br></O><br>

As demonstrated, sumList returns the total of List1 while sumRangeList returns the sum of values between 5-6th indices of List1.
To view this example in the library, see (https://openbrim.org/app/?incubator=1&author=ParamML_Examples_OpenBrIM+Platform&obj=objidqokstqo0bi25myjlp2zo2 )
Last updated