Elias Athanasopoulos wrote:
Well, you have to understand that the internal representation for Fixnum
values is different from most other objects in Ruby. If you create two
different Float objects with the same value, i.e.
x = 5.0
y = 5.0
then they are really two different objects, i.e.
x.id != y.id
but when you "create" two different Fixnum objects with the same value:
x = 5
y = 5
then they are references to the *same* object:
x.id == y.id is True
So the short answer is no, there's no way to change the value of a
Fixnum object like you could with a Float, even from C code. A Fixnum is
what it is.