Ruby supports integers and floating point numbers. Integers can be any length (up to a
maximum determined by the amount of free memory on your system).
Integers within a certain range (normally -230 to 230-1 or
-262 to 262-1) are held internally in binary form,
and are objects of class Fixnum. Integers outside this range are
stored in objects of class Bignum (currently implemented as a
variable-length set of short integers). This process is transparent,
and Ruby automatically manages the conversion back and forth.

You write integers
using an optional leading sign, an
optional base indicator (0 for octal, 0x for hex, or
0b for binary), followed by a string of digits in the
appropriate base. Underscore characters are ignored in the digit
string.

You can also get the integer value corresponding to an ASCII
character or escape sequence by preceding it with a question mark.
Control and meta combinations can also be generated using
?\C-x, ?\M-x, and ?\M-\C-x.
The control version of a value is the same as
``value & 0x9f''. The meta version of a value is
``value | 0x80''. Finally, the sequence ?\C-? generates an
ASCII delete, 0177.

A numeric literal with a decimal point and/or an exponent is turned
into a Float object,
corresponding to the native architecture's
double data type. You must follow the decimal point with a
digit, as 1.e3 tries to invoke the method e3 in class Fixnum.

All numbers are objects, and respond to a variety of messages (listed
in full starting on pages 290, 313,
315, 323, and
349). So, unlike (say) C++, you find the absolute
value of a number by writing aNumber.abs, not
abs(aNumber).

Integers also support several useful iterators. We've seen one
already---7.times in the code example
on page 47.
Others include upto and
downto, for iterating up and down between two integers, and
step, which is more like a traditional for loop.

Finally, a warning for Perl users.
Strings that contain numbers are
not automatically converted into numbers when used in
expressions. This tends to bite most often when reading numbers from a
file. The following code (probably) doesn't do what was intended.

The problem is that the input was read as strings, not numbers. The plus
operator concatenates strings, so that's what we see in the output.
To fix this, use the String#to_i method to convert the string to
an integer.