Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Huge Integer JavaScript Library

Is there any JavaScript library that can be used for calculations involving 700+ Digits? Also, how about the same thing in C++?

like image 716
Jibran Avatar asked Jun 08 '09 09:06

Jibran


3 Answers

JavaScript:

  • Leemon Baird's BigInt library. This seems to be popular. It's made specifically for cryptographic uses.
  • My own BigInteger library. Similar to the Java BigInteger class, but all calculations are done in base-10.
  • jsbn. Another BigInteger class similar to Java's. I've never used this one, but the API looks similar to mine.

C++:

  • Most people use GMP.
  • CLN - Class Library for Numbers. I've used this in the past and it has a pretty nice API.
like image 196
Matthew Crumley Avatar answered Nov 07 '22 17:11

Matthew Crumley


For JS: How about BigInt?

For C++: Google found me this.

like image 3
Assaf Lavie Avatar answered Nov 07 '22 15:11

Assaf Lavie


For C++ GMP has served me very well in the past for large numbers, it claims to be the fastest bignum library out there too, which is bound to be helpful for 700 digits.

like image 1
SteveL Avatar answered Nov 07 '22 17:11

SteveL