On Tue, 10 Feb 2004 00:38:38 -0600, "desa" <[EMAIL PROTECTED]> wrote:
>I have some code that uses fixed point math in 22.10 representation. So I >do a lot of bit shifting like this. > >int Number = 300 << 10; > >This doesn't work on a Palm though, because it uses Big Endian byte order. > >I had read that you need to swap the bytes before you perform the bit shift >and then swap them back. Is this correct? If so, what's the best way to do >this? No, you should not have to swap bytes, as long as your fixed point math does not make any assumptions about byte order. It it is written in C and does not use any casts, like (char*)(&int32value), then it should word regardless of the endian format. Robert Scott, Ypsilanti, MI (reply through this forum, not by e-mailing me directly) -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
