What is the standard solution in JavaScript for ha

2018-12-31 08:04发布

Is there a bignum library for JavaScript or built-in that I can include like

<script type="text/javascript" src="the_bignum_library.js"></script>

?

I think my users would prefer to enter numbers in a web page and wait 7 seconds for a result, rather than download an executable and click through a bunch of "this executable could possibly harm your computer" warning screens to install it.

I've considered basing my own off of http://github.com/silentmatt/javascript-biginteger or http://www.mainebrook.com/john/fun/euler.html. Or would you recommend calling from JavaScript into a Java bignum library such as apfloat?

2条回答
梦寄多情
2楼-- · 2018-12-31 08:48

If you need arbitrary-precision decimal numbers, use Javascript-bignum. This represents numbers as a sequence of decimal digits.

查看更多
长期被迫恋爱
3楼-- · 2018-12-31 09:01
登录 后发表回答