From: matz@... (Yukihiro Matsumoto) Date: 2000-11-21T01:33:25+09:00 Subject: [ruby-talk:6468] Re: Is there a FITS_IN_UINT(v)? Hi, In message "[ruby-talk:6464] Re: Is there a FITS_IN_UINT(v)?" on 00/11/21, Dave Thomas writes: |Alternatively, | | if a is a Fixnum, then it fits Not always, e.g. where sizeof(VALUE) == sizeof(long) > sizeof(int). This case, you can define UINTABLE by using FIXNUM_P, NUM2LONG and UINT_MAX. | if a is a Bignum then | it fits if a.size <= sizeof(int) You have to define how to handle negative Bignums first. Since Bignums have independent sign, -0xffff_ffff, for example, does not fit in 32 bit integer. matz.