Skip to content

feature: enable users to pass arrays to Decimal.sum#255

Open
hunterwilhelm wants to merge 1 commit intoMikeMcl:masterfrom
hunterwilhelm:fix-230
Open

feature: enable users to pass arrays to Decimal.sum#255
hunterwilhelm wants to merge 1 commit intoMikeMcl:masterfrom
hunterwilhelm:fix-230

Conversation

@hunterwilhelm
Copy link

Fixes #230

A minor conflict with #254 will happen. By choosing "Accept Combination", it will easily be resolved, since the changed lines don't overlap, they are just close enough to trigger it.

@MikeMcl
Copy link
Owner

MikeMcl commented Dec 24, 2025

Hello.

I'll consider this change, but I am uncomfortable with its inconsistency with other functions such as Decimal.max.

There is also the question of whether, for example, Decimal.sum(1, [2, 3]) should be supported to, as it doesn't really "enable users to pass arrays to Decimal.sum", it only enables them to pass one array as the first argument.

Also, this library is advertised as using ECMAScript 3 features only, and Array.isArray would break that.

Thank you for doing a careful job with the docs, test, and types updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decimal.sum with large arrays exceeds the maximum call stack size

2 participants

Comments