On Wed, Dec 5, 2012 at 12:24 PM, shyouhei (Shyouhei Urabe)
<shyouhei / ruby-lang.org> wrote:
> I'm not against these constant.  Just wanted to note that (for instance) max Fixnum can portally be obtained via:
>
> 1 << (1.size * 8 - 2) - 1

Not on JRuby. JRuby's Fixnum is always a full signed 64-bit integer.

system ~/projects/jruby $ jirb
irb(main):001:0> 1.size
=> 8
irb(main):002:0> big = java.lang.Long::MAX_VALUE
=> 9223372036854775807
irb(main):003:0> big.to_s(2)
=> "111111111111111111111111111111111111111111111111111111111111111"
irb(main):004:0> big.class
=> Fixnum
irb(main):005:0> small = java.lang.Long::MIN_VALUE
=> -9223372036854775808
irb(main):006:0> small.to_s(2)
=> "-1000000000000000000000000000000000000000000000000000000000000000"
irb(main):007:0> small.class
=> Fixnum

I support adding MIN and MAX to Fixnum.