From: Tanaka Akira <akr@...> Date: 2013-06-05T22:11:17+09:00 Subject: [ruby-core:55318] Re: [ruby-trunk - Feature #6065] Allow Bignum marshalling/unmarshalling from C API 2012/2/25 Yusuke Endoh <mame@tsg.ne.jp>: > I agree with akr; Martin's proposal depends on the type long, which > is not "portable" enough. For designing the APIs, I think we should > refer gmplib, which is a giant in this area. > > http://gmplib.org/manual/Integer-Import-and-Export.html At first time I see that, I guess there is no application of "nails" argument. Now I think I know several applications: * Integer#to_s(radix) for radix is power of 2 For example, i.to_s(2) can be implemented using that with size=1 and nails=7 and 0 and 1 are converted to '0' and '1' later. * BER-compressed integer for pack (size=1 and nails=1) -- Tanaka Akira