I was wondering why Ruby calls it Fixnum; other languages call it Integer, Int, Number, etc. I saw that Fixnum < Integerand Bignum < Integer, and Integer < Numeric, and Float < Numeric. I guess this is due to size:
1.class => Fixnum
(10**100).class => Bignum
And from the document :
Holds Integer values that can be represented in your own machine word (minus 1 bit). If any operation in Fixnum exceeds this range, the value is automatically converted to a Bignum value
Why a name Fixnum? I was thinking about a fixed number, but this is not fixed, as well as a fixed size.
source
share