Boost logo

Boost :

Subject: Re: [boost] Fixed point integer proposal
From: John Bytheway (jbytheway+boost_at_[hidden])
Date: 2009-06-25 15:51:12

Phil Endecott wrote:
> Soren Holstebroe wrote:
>> In my template N bit x N bit equals N bit per default.
> Which of the 2N possible bits do you keep, and which do you discard?
> I chose to try to behave as closely as possible to how built-in integer
> types work. If I multiply uint8_t * uint8_t and assign the result to a
> uint32_t, it works.

Yes, but if you multiply a uint32_t by a uint32_t and assign to a
uint64_t, then it doesn't work (assuming int == uint32_t). Do you want
a fixed point library to mimic these apparent inconsistencies? It would
probably make it less portable, since sizeof(int) isn't the same everywhere.

John Bytheway

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