Yukihiro Matsumoto
10/26/2006 6:35:00 AM
Hi,
In message "Re: Bitwise inversion of Bignum"
on Tue, 24 Oct 2006 22:49:24 +0900, Ian Roddis <ian.roddis@gmail.com> writes:
|A bitwise inversion of a Bignum sometimes yields odd results. As tested
|in 1.8.5:
|
|./ruby -v
|
|ruby 1.8.5 (2006-08-25) [i686-linux]
|./ruby -e 'a= "7fffff00".hex ; b= "ffffff00".hex ; printf "%b => %b\n",
|a, ~a ;
|
|printf "%b => %b\n", b, ~b'
|1111111111111111111111100000000 => ..10000000000000000000000011111111
|11111111111111111111111100000000 => ..1
|
|In the first case, the '..1' is expected, as per the documentation, but
|annoying.
Both of them are as expected from my view point. What did you expect?
matz.