MikeMcl / decimal.js

An arbitrary-precision Decimal type for JavaScript
http://mikemcl.github.io/decimal.js
MIT License
6.35k stars 480 forks source link

Maximum call stack size exceeded #219

Closed expcapitaldev closed 1 year ago

expcapitaldev commented 1 year ago

Is it a known issue that this code:

// Either NaN, Infinity or 0?
      if (!xd || !xd[0] || !yd || !yd[0]) {

        return new Ctor(// Return NaN if either NaN, or both Infinity or 0.
          !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :

          // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
          xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);
      }

Returns an error "Maximum call stack size exceeded"? Or it works as expected and there are values with which it happens?

MikeMcl commented 1 year ago

I don't understand what you mean.

If you have an example where a 'maximum call stack size exceeded' error occurs then please provide it.

expcapitaldev commented 1 year ago

We've got a sentry error that leads to decimal.js, to be precise to the code above. We don't know exactly how it happened and thought that you'd know :)

MikeMcl commented 1 year ago

The line number or the name of the function that contains that code, and a minimal reproducible code example is required for me to investigate further. Closing until that is provided.