You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the Decimal.sum function requires spreading the array contents, which may lead to exceeding the maximum call stack size for large arrays. This results in a breaking point, and the function fails for arrays around 70k elements.
Expected Behaviour
The Decimal.sum function should be modified to accept an array directly, rather than relying on spreading the array contents so that large arrays can be summed.
Problem
The current implementation of the Decimal.sum function requires spreading the array contents, which may lead to exceeding the maximum call stack size for large arrays. This results in a breaking point, and the function fails for arrays around 70k elements.
Expected Behaviour
The Decimal.sum function should be modified to accept an array directly, rather than relying on spreading the array contents so that large arrays can be summed.
Steps to Reproduce
Create a large array, for example:
Attempt to use Decimal.sum with the large array:
Environment
decimal.js: ^10.4.3
Node.js version: v18.17.1
TypeScript version: 5.2.2
The text was updated successfully, but these errors were encountered: