Large integers in javascript (more the 2^53-1)

2019-01-20 00:17发布

问题:

What is general principals to operate with large integers in javascript? Like in libraries for bigint? How i do it by myself?

回答1:

You may take a look at this implementation. You may also find other implementations useful.



回答2:

Another option I've used in the past, is to hand off those operations to a calculation server via jsonp. If you're working with such large numbers, you likely want the improved performance and precision this can give you.