views:

118

answers:

2

Could your recommend some good big integer calculation library in C/C++/Java and it is better to support logarithmetic.

Thanks.

A: 

Java has classes for that in java.math. (BigInteger for instance.)

+4  A: 
  • For C/C++ I would recommend the GNU Multiple Precision Library.
  • For Java you might check the built-in math API. It provides by far less functionality than GMP, but depending on what you need, it might meet your requirements.
fabstab
I mostly agree, but one should only use Java's stuff for values _slightly_ larger than longs. Otherwise, the algorithms they use are horribly slow (very bad asymptotic performance as your numbers get huge). Use GMP (Gnu Multiple Precision library) instead. Wrap GMP for Java, if you need Java.
Rex Kerr