Boost logo

Boost :

From: Stephen Nutt (snutt_at_[hidden])
Date: 2002-08-30 21:16:04


> I have had uses for such a library in the past, and I know
> that others working in the 'financial' domain have a need
> for this as well.
>
> >From my perspective it would be nice if you could work
> with Bill's proposal and explain how your proposal compares.
> I know he recently uploaded a new version (which I have not
> had time to review). There has been a fair amount of discussion
> and refinement of his proposal so I would hate to lose that
> history.

Bill's proposal is excellent. Obviously much thought, work and detail went
into his fixed decimal class and I'd love to borrow ideas. I don't have any
formal proposal yet as I'm still bouncing around ideas.

The basis of the fixed class I propose is that the fixed point number is
represented by a single integer variable that can be signed or unsigned, of
any legal integer size. The class will allow for an arbitrary number of
bits to be assigned to the integer portion of the fixed point number from
zero up to an including all the bits in the integer. By keeping the fixed
number binary, two different fixed point numbers can be efficiently added or
subtracted with only a single additional shift operation when compared to
integer arithmetic. Multiplication and division of large fixed point
numbers will be a little more complex so not to lose any precision, while
smaller fixed point numbers can be multipled and divided also with only a
single additional shift operation when compared to integers.

The various insertion and extraction operators for iostreams will be simpler
then Bill's fixed decimal, while more work will be placed on arithmetic
operators.

Thanks,

Stephen


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