At 03:00 PM 3/8/2001 +0000, David Mitchell wrote:

> > The C structure that represents a bigint is:
> >
> >    struct bigint {
> >      void *num_buffer;
> >      UV length;
> >      IV exponent;
> >      UV flags;
> >    }
> >
>[snip]
> > The C<num_buffer> pointer points to the buffer holding the actual
> > number, C<length> is the length of the buffer, C<exponent> is the base
> > 10 exponent for the number (so 2e4532 doesn't take up much space), and
> > C<flags> are some flags for the bigint.
>
>Err... what representation is enivsaged for bigints? I had assumed it
>would be (length*8)-bit 2's complement,

I was thinking maybe (length/4)*31-bit 2s complement to make portable 
overflow detection easier, but that would be only if there wasn't a good C 
library for this available to snag.

>but the the later bit about
>base-10 exponents and digits made me wonder if you were actually intending
>a string (or BCD) represenation?

It probably ought to be left undefined, in case we switch implementations 
later.

>In either case, the PDD needs to make it clear. (And if the latter,
>then permission to say "yuk!")

Yep. (And who ever needed permission on a perl development list to say 
"yuck"? Or anything else, for that matter... :)

>bignum perhaps also needs some clarification.

No doubt.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to