1. Home
  2. Computing & Technology
  3. Ruby
photo of Amanda & Michael Morin
Amanda and Michael's Ruby Blog

By Amanda & Michael Morin, About.com Guides to Ruby

Ruby's Bignum Library

Monday November 17, 2008

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

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Discuss
Community Forum
Explore Ruby
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Ruby

©2009 About.com, a part of The New York Times Company.

All rights reserved.