Doing 64 bit manipulation using 32 bit data in Fixed point arithmetic using C.
Posted
by Viks
on Stack Overflow
See other posts from Stack Overflow
or by Viks
Published on 2010-04-18T04:42:51Z
Indexed on
2010/04/18
4:43 UTC
Read the original article
Hit count: 425
Hi,
I am stuck with a problem. I am working on a hardware which only does support 32 bit operations.
sizeof(int64_t) is 4. Sizeof(int) is 4.
and I am porting an application which assumes size of int64_t to be 8 bytes. The problem is it has this macro BIG_MULL(a,b) ( (int64_t)(a) * (int64_t)(b) >> 23)
The result is always a 32 bit integer but since my system doesn't support 64 bit operation, it always return me the LSB of the operation, rounding of all the results making my system crash.
Can someone help me out?
Regards, Vikas Gupta
© Stack Overflow or respective owner