1. Computing & Technology

Discuss in my forum

Ruby's Bignum Library

About Computers and Math

By , About.com Guide

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.

©2012 About.com. All rights reserved.

A part of The New York Times Company.