From: Gene Tani Date: 2005-10-31T23:22:06+09:00 Subject: Re: determining whether an object is an immediate? I'm confused, don't you need to only check that least signif. bit is 1, whereas #zero? and #nonzero? look at everything except LSB on a Fixnum, once they've figured out whether object is Fixnum, Float or Bignum? Also, i noticed that python people noticed about tagged integers: http://mail.python.org/pipermail/python-dev/2004-July/046139.html Eric Mahurin wrote: > Looking at the C code (ruby.h: SPECIAL_CONST_P), another option would be > this: > > id = obj.__id__ > (id&3).nonzero? || (id&~4).zero? > > As long as ruby continues to encode immediates as it does now (can add > more), this should work.