I have written a little program to calculate Fibonacci numbers up to F(300).
If you have knowledge of Fibonacci, you'll know that the number get very large, very quickly.
F(300) =2222322446294204455297398934619099672066669390964 99764990979600
Obviously this number can't be stored in an Int or Long etc. To solve the issue I've used Java's BigInteger Class to store these numbers. It works well. However, I would like to understand how BigInteger works "under the hood". Does it store the numbers as byte arrays, as Strings etc?
Java's API for BigInteger doesn't seem to specify how it works in terms of how it stores numbers, just how to use the class. If anyone can explain, or point me in the direction of a write up on how BigInteger stores it's numbers that would be quite helpful.
Which makes me think that perhaps what they do is they create an array where each array element corresponds to a digit. That way you're not limited on size, per say. And with the many copy algorithms out there for increasing array size I wouldn't be surprised.
However this is only a guess.
I found the GNU Open Source BigInteger implementation which I would guess just about mimics it.