%PDF- %PDF-
| Direktori : /home2/rezakur1/ai.rezakurnia.com/zh-router-frontend/node_modules/es-toolkit/dist/bigint/ |
| Current File : //home2/rezakur1/ai.rezakurnia.com/zh-router-frontend/node_modules/es-toolkit/dist/bigint/sum.d.ts |
/** * Calculates the sum of an array of bigints. * * This function takes an array of bigints and returns the sum of all the elements in the array. * An empty array returns `0n`, so `sum(a) + sum(b)` always equals `sum([...a, ...b])`. * * @param nums - An array of bigints to be summed. * @returns The sum of all the bigints in the array. Returns `0n` for an empty array. * * @example * const numbers = [1n, 2n, 3n, 4n, 5n]; * const result = sum(numbers); * // result will be 15n */ export declare function sum(nums: readonly bigint[]): bigint;