sum
Function
The sum of the elements of a fixed-size array of numbers or vectors, sum(xs), unrolled into one addition per element.
The signature and the sentence under each name are the compiler's own text at commit 26de7be8.
Syntax
declare function sum<T extends Numeric>(xs: array<T>): TA signature may name a type the ambient file declares for its own use. These are those declarations.
Numerictype Numeric = number | vec2 | vec3 | vec4 | vec2i | vec3i | vec4i | vec2u | vec3u | vec4u
Parameters
-
xsarray<T>
Return value
T