
25 Jun
2009
25 Jun
'09
7:51 p.m.
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