To: djgpp AT delorie DOT com Subject: Re: fixed point math: NEED HELP QUICK! Message-ID: <19970131.205344.8463.0.chambersb@juno.com> References: <5clmjm$ee3 AT nr1 DOT toronto DOT istar DOT net> From: chambersb AT juno DOT com (Benjamin D Chambers) Date: Fri, 31 Jan 1997 23:52:33 EST On Thu, 30 Jan 1997 02:15:42 +0000 Paul Shirley writes: >In article <199701290130 DOT UAA02417 AT delorie DOT com>, DJ Delorie > writes >> >>> function. Anyway, here's my problem; To my understanding the >following >>> are 100% equal: >>> >>> other_stuff = stuff / 256; >>> other_stuff = stuff << 8; >> >>The second multiplies. Try ">> 8" instead. >> > >And if other_stuff is signed, >>8 and /256 aren't identical either. >(which might save you some debugging later ;) Actually they are. If it's signed, then I've noticed gcc shifts in the sign bit (with sal instead of shl). ...Chambers