Boost logo

Boost :

Subject: Re: [boost] Looking for some "real world" extended precision integer arithmetic tests
From: Andrii Sydorchuk (sydorchuk.andriy_at_[hidden])
Date: 2012-03-23 08:34:01


>
> Yes, there are currently problems with the random number code not
> compiling with GCC, but apart from that it's all in pretty good shape (I
> hope!), docs here: http://svn.boost.org/svn/**
> boost/sandbox/big_number/libs/**multiprecision/doc/html/boost_**
> multiprecision/tut/ints.html<http://svn.boost.org/svn/boost/sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/ints.html>

Great, I'll have a look.

No, just one implementation, but it implements the equivalent of the
> small-string-optimization - which is to say the header for the dynamicly
> allocated buffer is in a union with a small internal buffer. The internal
> buffer is used first, then if the number grows too large a dynamic buffer
> is used. The template parameter controls the size of this internal cache -
> it defaults to the same size as the dynamic buffer header, but can be made
> larger if that helps.
> Finally, if the allocator is void, then no dynamic allocation ever takes
> place, and we have a fixed precision type, some of the core code gets
> simplified in this case as well.
> Otherwise, an unbounded integer with a large cache provides almost the
> best of both worlds - very nearly as fast as the fixed precision version,
> but no need to worry about overflow.

Sounds like a very nice solution.

There are some other specialized routines (for squaring for example) that I
> also need to implement, as well as experiment with column-first
> multiplication to see whether it gains anything....

Yes, most of those could be incrementally added.

Cheers, Andrii

Unsubscribe & other changes: http://lists.boost.org/**
mailman/listinfo.cgi/boost<http://lists.boost.org/mailman/listinfo.cgi/boost>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk