>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:

  DS> 'Kay, here's the final version of this.
  DS>    struct bigint {
  DS>      void *buffer;
  DS>      UV length;
  DS>      IV exponent;
  DS>      UV flags;
  DS>    }

  DS> =begin question

  DS> Should we scrap the buffer pointer and just tack the buffer on the end
  DS> of the structure? Saves a level of indirection, but means if we need
  DS> to make the buffer bigger we have to adjust anything pointing to it.

i think the indirection is good for that reason. tracking all refs to
this structure is a lot of work for any resize operations.

  DS> =end question

  DS> The C<num_buffer> pointer points to the buffer holding the actual

s/num_//

  DS> and yes, this looks identical to the bigint structure. This isn't
  DS> accidental. Upgrading a bigint to a bignum should be quick.


question:

can you declare at the language level a scalar to be a bigint or bignum?
that means that native format is never used. the reason might be
something like a fixed point decimal value for money with 2 decimal
places. the bigint/float thingies imply decimal math and that also means
a decimal math library. this came up in #perl in a discussion about
bcd. i think a true decimal math package for this would be useful and
faster than a char string based one.

uri

-- 
Uri Guttman  ---------  [EMAIL PROTECTED]  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info:     http://www.sysarch.com/perl/OOP_class.html

Reply via email to