1. Computing

Ruby's Bignum Library

About Computers and Math

By

Computers are quite good at math or, more precisely, at arithmetic. In fact, technically, that's all a computer can do. However, the numbers computers typically work with are quite limited. On a typical computer, an integer number is represented by a 32-bit binary number. A 32-bit integer can only represent the numbers from about negative 2 billion to positive 2 billion.

While that's quite a big range, and will probably encompass most uses of integers you can think of, it's still not quite good enough for all cases. What if you're calculating the mass of a very large star based on astronomical observations? You're definitely going to need something that can handle larger numbers.

  1. About.com
  2. Computing
  3. Ruby
  4. Advanced Ruby
  5. Ruby's Bignum Library

©2014 About.com. All rights reserved.