1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/docs/lib3x-sum.md

17 lines
271 B
Markdown
Raw Normal View History

2020-05-23 11:20:33 +08:00
# sum
Use `+` to sum up all elements in a list.
**Since:** 2.4
## Parameters
- `lt` : a list of elements that can be applied by `+`.
## Examples
use <util/sum.scad>;
assert(sum([1, 2, 3, 4, 5]) == 15);
assert(sum([[1, 2, 3], [4, 5, 6]]) == [5, 7, 9]);