UPDATE : With Ruby 2.4, the Fixnum and Bignum have disappeared, there is only Integer . Exact optimizations still exist, but they are considered as “correct” compiler optimizers, i.e. Behind the scenes, invisible to the programmer.
This is somewhat confusing. Integer is the real class you should think about. Fixnum is basically a performance optimization that should never have been seen by a programmer in the first place. (Compare this to flonums in YARV, which are implemented entirely as optimizations within the VM and are never exposed to the programmer.)
Basically, Fixnum fast and Bignum is slow (er), and the implementation automatically switches between them. You never ask one of them directly, you just get one or the other, depending on whether your integer fits a limited size Fixnum or not.
Jörg W Mittag Jan 28 '14 at 16:28 2014-01-28 16:28
source share