问题描述
是否有用于JavaScript或内置的bignum库,我可以包含
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>
?
我想我的用户会喜欢在网页中输入数字并等待7秒以获得结果,而不是下载可执行文件并点击一堆此可执行文件可能会损害您的计算机警告屏幕进行安装。
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.
我考虑过基于或。或者你会建议从JavaScript调用Java bignum库,如apfloat?
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?
推荐答案
如果你需要任意精度的十进制数,使用。这表示数字为十进制数字序列。
If you need arbitrary-precision decimal numbers, use Javascript-bignum. This represents numbers as a sequence of decimal digits.
这篇关于JavaScript处理大数字(BigNum)的标准解决方案是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!