MCPcopy Create free account
hub / github.com/Effect-TS/effect / sumAll

Function sumAll

packages/effect/src/BigInt.ts:748–754  ·  view source on GitHub ↗
(collection: Iterable<bigint>)

Source from the content-addressed store, hash-verified

746 * @since 2.0.0
747 */
748export const sumAll = (collection: Iterable<bigint>): bigint => {
749 let out = bigint0
750 for (const n of collection) {
751 out += n
752 }
753 return out
754}
755
756/**
757 * Takes an `Iterable` of `bigint`s and returns their product as a single `bigint`. Returns `1n` for an empty iterable.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected