From: nobu.nokada@... Date: 2003-05-29T20:29:24+09:00 Subject: Re: RCR: unpack/pack Bignum Hi, At Thu, 29 May 2003 19:45:24 +0900, Robert Feldt wrote: > but what about > > [0x010203].pack("N(2)") > > ? Should it truncate? MSB or LSB? I guess "N(2)" is equivalent to "n", so the behavior should be consist with the current one. But it differs for Fixnum and Bignum. Which is better? $ ruby -e 'p [0x010203].pack("n")' "\002\003" $ ruby -e 'p [0x0102030405].pack("n")' -e:1:in `pack': bignum too big to convert into `int' (RangeError) from -e:1 > How can this be used when I have a Bignum that I don't know how large it > will be? 'N(*)'? I expect '(*)' would mean to convert all remained data like as 'a*' does, though you need to know the exact template to pack/ unpack fundamentally. -- Nobu Nakada