As the accepted answer on the question you linked to says, 0, 20, and 8 are the Object IDs that are used when using flonums on YARV.
So, obviously, your Windows implementation is not using flonums. The most likely reason is that either you are not using YARV (e.g. using JRuby or Rubinius), or you are using YARV, but a 32 bit version.
Note: Object IDs are a private internal implementation detail of the particular Ruby implementation. The version of Ruby you are using is completely irrelevant. What is relevant is which implementation you are using, which version, which commandline options, how you compiled it, what your environment is and so on. It has nothing to do with the language.
Note also: you should never ever rely on the specific value of Object IDs. Object IDs guarantee two things, and only these two things:
- An object does not change its Object ID during its lifetime.
- No two objects have the same Object ID at the same time.
Here are some things that are not guaranteed:
- It is not guaranteed that an object will have the same Object ID during different runs of the program.
- It is not guaranteed that an Object ID is unique during the runtime of the program, it may be re-used for different objects as long as those objects don't live at the same time.
- It is not guaranteed that the Object ID will follow a certain pattern, e.g. that it is always the memory address of the object (not true on JRuby, for example) or that it is always a specific value (not true for
nil
and false
, as you have just discovered), or that it is always related to the object's value in some way (due to the specific way that YARV optimizes Integer
s, the Object ID for small integers will always be 2n+1, but that is only true for small integers (where the definition of "small" depends on whether you run a 64 bit or 32 bit version of YARV) and it is only an implementation detail that may change at any moment without notice).