From: Mr Magpie Date: 2007-04-30T13:04:18+09:00 Subject: Why is 0x7FFFFFFF Bignum and not Fixnum ? According to the Pickaxe book : "A Fixnum holds Integer values that can be represented in a native machine word (minus 1 bit). If any operation on a Fixnum exceeds this range, the value is automatically converted to a Bignum." In IRB : >> 0x3FFFFFFF.class => Fixnum >> 0x3FFFFFFF.size => 4 As expected, this comfortably fits into 32 bits, but so should this : >> 0x7FFFFFFF.class => Bignum >> 0x7FFFFFFF.size => 4 1) Why has it gone to Bignum ? it shouldn't do this until 0x80000000. 2) Interestingly, BigNum has recognised it fits into 32 bits, but it was upsized anyway ! I'm trying to do some performance critical bit manipulations (without leaving ruby) and this means I'll be using BigNum unnecessarily. Regards Magpie -- Posted via http://www.ruby-forum.com/.