Boost logo

Boost :

From: John Femiani (JOHN.FEMIANI_at_[hidden])
Date: 2007-04-19 01:03:21

> Operations between fixed-point values of different sizes are possible,

> and return a fixed-point value with sufficient bits to store the
> result. For example:
> fixed<10,4> a;
> fixed<15,2> b;
> fixed<15,4> c;
> c = a + b;
>..except that actually one more bit is needed in the maximum-value
> case. There are no doubt more opportunities for refinement in this

I for one am very interested, provided that they can be parameterized
for overflow and rounding policies, and that max-value case is handled
so that operations are not lossless until the machine limit is reached
(64 bit or 32 bit) or until an assignment to a smaller type is made.

I also would like signed and unsigned versions, and some examples of the
generated machine code or performance metrics showing how the generated
code compares to hand coded fixed point or integer arithmetic.

I personally was thinking that the effective way to use fixed point
arithmetic would end up involving expression templates (Proto?) or
something and a zillion hand-coded specializations for whole

In particular I am interested in using this kind of thing with GIL so
that I can multiply pixels better.


Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at