(collection: Iterable<bigint>): bigintTakes an Iterable of bigints and returns their product as a single bigint. Returns 1n for an empty iterable.
When to use
Use to multiply all bigint values in an iterable.
Example (Multiplying iterable bigints)
import { BigInt } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigInt.multiplyAll([2n, 3n, 4n]), 24n)Source effect/BigInt.ts:79910 lines
export const const multiplyAll: (
collection: Iterable<bigint>
) => bigint
Takes an Iterable of bigints and returns their product as a single bigint. Returns 1n for an empty iterable.
When to use
Use to multiply all bigint values in an iterable.
Example (Multiplying iterable bigints)
import { BigInt } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigInt.multiplyAll([2n, 3n, 4n]), 24n)
multiplyAll = (collection: Iterable<bigint>collection: interface Iterable<T, TReturn = any, TNext = any>Iterable<bigint>): bigint => {
let let out: bigintout = const bigint1: bigintbigint1
for (const const n: bigintn of collection: Iterable<bigint>collection) {
if (const n: bigintn === const bigint0: bigintbigint0) {
return const bigint0: bigintbigint0
}
let out: bigintout *= const n: bigintn
}
return let out: bigintout
}