From: Tanaka Akira <akr@...>
Date: 2013-06-25T18:20:00+09:00
Subject: [ruby-core:55646] Re: [ruby-trunk - Feature #8553] Bignum#size (and Fixnum#size)

2013/6/25 headius (Charles Nutter) <headius@headius.com>:
> Issue #8553 has been updated by headius (Charles Nutter).

> I guess the question is: what should Bignum#size actually mean? The minimal representation? The actual byte size being used in a given Bignum object? bitLength goes along with minimal representation here.

The answer for the question is not clear.
However, I think no one expects multiples of sizeof(BDIGIT).

> JRuby is the same result as Rubinius except for (-(1<<n)).size, which probably reflects the JVM excluding the sign bit (?).

It is the difference between absolute value and two's complements.
-- 
Tanaka Akira