Boost logo

Boost :

Subject: Re: [boost] [xint] Question about suitability, portability, and "Boostiness"
From: DE (satan66613_at_[hidden])
Date: 2010-04-14 12:11:21


on 14.04.2010 at 19:50
 Domagoj Saric wrote :
> Considering it is an ancient trick and that any compiler targeting an OS as
> widespread as Windows has to 'support' it (e.g. BITMAPINFO struct) it is
> probably safe to assume as 'safe'/portable...

> OTOH, it would be great if you could separate the core 'big int'/math logic from
> the storage/allocation logic, for example have:
> - a base 'math handling' class with functions that all take the actual location
> and size of the number as parameters

a very good point
this way it would be almost trivial to implement an arbitrary
precision number as well as fixed precision numbers (e.g.
'xint::fixed<128>')
oh, you already wrote that:
> - a wrapping template class(es) that can be configured with policies whether to
> use/work with fixed sized buffers/numbers (thus no memory allocation, thus no
> exception handling code, thus maximally lean code) or dynamically sized buffers
> (with or without SBOs, deep or shallow copies, reference counting etc etc...)...

and a policy regulating whether to use ordinary arithmetic or modulo
one would be vital
e.g. a natural expectation is that a fixed 128 bit integer does
modulo (2^128) arithmetic

-- 
Pavel
P.S.
if you notice a grammar mistake or weird phrasing in my message
please point it out

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