Tuesday, April 07, 2009

BigInteger

Well I now have a working C++ BigInteger class. The only problem is that so far it is only able to do addition and multiplication. I am fine with the speed of the additions since you can't do any better. The multiplication is where the main problems are located. Sure the method works but it is way too slow. I just need to figure out how to convert a string that represents a number in base 10 into a string that represents the same number in binary. Once I am able to do this I know how to perform faster multiplication algorithms. A similar problem will be converting the answer (which will be in binary) back to decimal.

Regardless I would still like to add a method for modular arithmetic and possibly division, these would just be nice to have but not necessary. Also I should probably work on getting it to handle negative numbers as well.

No comments: