Changes

Jump to: navigation, search

Ruby Number Classes and Conversions

16 bytes added, 14:03, 31 March 2009
no edit summary
== Ruby Number Classes ==
Ruby provides a number of builtin built-in number classes. In this section we will explore some of the more commonly used classes.
=== Integer Class ===
A Fixnum holds Integer values that can be represented in a native machine word (minus 1 bit). This effectively means that the maximum range of a Fixnum value depends on the architecture of the system on which the code is executing.
If an operation performed on a Fixnum exceeds the range defined by the system's marchine machine word, the value is automatically converted by the interpreter to a Bignum.
=== Bignum Class ===
Rational implements a rational class for numbers.
A rational number is a number that can be expressed as a fraction p/q where p and q are integers and q != 0is not equal to zero. A rational number p/q is said to have numerator p and denominator q. Numbers that are not rational are called irrational numbers.
== Converting Numbers in Ruby ==

Navigation menu