Ruby's Bignum Library
While computers are exceptional at arithmetic (after all, isn't that what they do?), the process of representing integers by 32-bit binary numbers can significantly limit the integers that can be worked with. It may seem as though being able to work with numbers in the range of -2,000,000,000 to +2,000,000,000 encompasses a lot, but the truth is that sometimes you need bigger numbers. Consider the national debt as one example.
That's where Bignums come in. Bignums store numbers as a series of decimal digits instead of as a binary number. While this has some limitations, it also has some huge advantages as the use of the Ruby Bignum Library demonstrates.


Comments
No comments yet. Leave a Comment