On Thu, 29 May 2003 nobu.nokada / softhome.net wrote:

> Hi,
>
Hi and thanks for your comments,

> I guess Bignum (un)packing would be used for external data
> exchange, so it'd be better to provide each singned/unsigned
> and big/little endian conversion, like as 'l', 'L' and so on.
> But 'w' is used already.
>
Hm, I've envisioned Bignum (un)packing for cryptographic applications
where nonnegative num <-> MSB-first string is all there is, but maybe
you're right. But there are very many combinations (signed/unsigned,
big/little endian for full string and for groups of 2/4 bytes etc). Which
ones should be supported?

What is 'w' used for? I had missed that one.

> A nitpicking:
> > -                len = RBIGNUM(from)->len * SIZEOF_BDIGITS;
> > -                {
> > -		    char tmp[len];
> > -
> > -                    rb_nonneg_bignum_pack(tmp, from);
> > -		    // Skip leading zeroes if positive bignum. Extend
> > -		    // this "strategy" for 'w' so that only negative
> > -		    // bignums (and 0) can have leading zero?
>
> Variable length array and C++ style comment are C99 feature (or
> a compiler's extension).
>
Yeah thats right, sorry. Easy to fix if there is interest in this patch. I
also made a late-night mistake of doing the patches the wrong way... :)

Regards,

Robert