处理 javascript 个数字大于 16 的数字

Handle javascript numbers with digits larger than 16

我试着在论坛上查找如何处理大于 16 的数字。到目前为止我发现了这个 post:

How can I handle numbers bigger than 17-digits in Firefox/IE7?

没有提供解决方案,只是建议做一些技巧来处理操作。

我也在网上寻找可以解决这个问题的图书馆,例如这个图书馆,它再次受到 15 位数字的限制。

http://mikemcl.github.io/decimal.js/#precision

对于大于15的数字,还有哪些算术运算的处理方式?

尝试寻找十进制数学任意精度库。

"Decimal math" 表示它对十进制数字而不是二进制数字进行运算。

Decimal floating point (DFP) arithmetic refers to both a representation and operations on decimal floating point numbers. Working directly with decimal (base 10) fractions can avoid the rounding errors that otherwise typically occur when converting between decimal fractions (common in human-entered data, such as measurements or financial information) and binary (base 2) fractions.

Arbitrary precision表示对位数没有硬性限制。

In computer science, arbitrary-precision arithmetic, also called bignum arithmetic, multiple precision arithmetic, or sometimes infinite-precision arithmetic, indicates that calculations are performed on numbers whose digits of precision are limited only by the available memory of the host system. This contrasts with the faster fixed-precision arithmetic found in most arithmetic logic unit (ALU) hardware, which typically offers between 8 and 64 bits of precision.

Is there a decimal math library for JavaScript? 可能是一个很好的起点。