Mail Archives: djgpp/1996/06/26/09:26:30
> I am curious. Is there any reason long long ints are not used for fixed
> point math? It would provide 64 bits of precision.. Making a 32.32
> possible...
You cannot use long long ints for fixed point math because you would need
a 128 bit number for intermediate values in the multiply operation. This is
because fixed point multiplication is performed by multiplying A(32) * B(32)
which yields C(64) which is then rounded up and shifted back to a 32 bit
value. The basic fact is that a 64 bit number times a 64 bit number does not
always yield a 64 bit number. You could do a 64 bit fixed point system, but
it would require more than the native addition, multiplication, and shift
instructions of the 80x86. Now, if you had a DEC Alpha...
- Raw text -