From: Stephen Nutt (snutt_at_[hidden])
Date: 2002-09-03 19:13:36
I took a brief look at thw fixed point work going on in J11/WG14, but
confess I've yet to read all 91 pages. As I understand it there will be two
new types, _Fract and _Accum both of which can we modified with
signed/unsigned and an integer size (short, long, int etc.) I believe the
class I propose will be functionally similar and will differ mainly in the
declaration of the variable.
Using a template will allow us to specify the underlying storage type of the
data, signed int, unsigned short etc. While it could be done with a union,
the code will become more complex, and there will be additional storage
beyond the required amount for smaller types (char, short.)
> would seem to be a natural for templates. For example, since we
> couldn't implement the pragmas, could sat/modwrap and 1-or-2 ulp
> accuracy be policies?
Is a policy a template parameter?
I didn't know there was a cheap and easy way to get 2ulp. All my
calculations are currently 1ulp but I can reconsider my multiply and divide
for an optional and faster 2ulp.
Thanks for all the great feedback from all of you,
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk