Items are added in source order, seeding the total with the first one, so summing stays within constant memory
whatever the size of the feed, but never completes on an infinite source. number items are added as IEEE 754
doubles and bigint items as exact integers: a feed is expected to carry one numeric type throughout, and mixing
the two is reported rather than silently coerced.
An empty feed resolves to undefined; callers wanting the additive identity supply it with ?? 0 or ?? 0n.
Creates a sink summing the items of the feed.
Items are added in source order, seeding the total with the first one, so summing stays within constant memory whatever the size of the feed, but never completes on an infinite source.
numberitems are added as IEEE 754 doubles andbigintitems as exact integers: a feed is expected to carry one numeric type throughout, and mixing the two is reported rather than silently coerced.An empty feed resolves to
undefined; callers wanting the additive identity supply it with?? 0or?? 0n.