javascript中如何处理大数字
我正在寻找一个处理真正(长、大、巨大、风暴)数字的数学解决方案。我还没有发现任何东西,但我不想认为这个问题目前还没有解决。我正在寻找一个简单的数字解决方案,例如 Microsoft Excel Precision(30 位小数)或 BigInteger (Java) 解决方案。当然是用Javascript。
I'm looking for a Mathematical solution that deals with really (long, big, huge, storms) numbers. I haven't found anything yet, But I don't wanna think that this problem hasn't be solve at this time. I'm looking for an easy Number solution, like Microsoft Excel Precision (30 decimals), or a BigInteger (Java) solution. in Javascript of course.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在为 ElGamal 加密实现寻找大整数库时,我测试了几个库,结果如下:
我推荐这个: Tom Wu 的 jsbn.js (http://www-cs-students.stanford.edu/~tjw/jsbn/)
Leemon Baird 的大整数库 (http://www.leemon .com/crypto/BigInt.js)
bignumber.js (https://github.com/MikeMcl/bignumber.js)
JavaScript 的 Schema 算术库 (https://github.com/jtobey/javascript-bignum)
我自己还没有测试过这个: BigNumber (http://jsfromhell.com/classes/bignumber)
While looking for an big integer library for an ElGamal crypto implementation I tested several libraries with the following results:
I recommend this one: Tom Wu's jsbn.js (http://www-cs-students.stanford.edu/~tjw/jsbn/)
Leemon Baird's big integer library (http://www.leemon.com/crypto/BigInt.js)
bignumber.js (https://github.com/MikeMcl/bignumber.js)
Scheme arithmetic library for JavaScript (https://github.com/jtobey/javascript-bignum)
I haven't tested this by myself: BigNumber (http://jsfromhell.com/classes/bignumber)
这里有一个 JavaScript 的 BigInteger 库:
(请注意我自己没用过这个,试试看你的想法。)
There's a BigInteger library for JavaScript available here:
(Note that I haven't used this myself. Try it and see what you think.)
还有 Silent Matt 的大整数库。它不处理小数。
There is also Silent Matt's library for Big Integers. It does not handle decimals.