GP2X Writing Fast Code For The Gp2x ..


Incarnate posted on Apr 8 2006 at 10:10 PM said:
You can lose accuracy too with larger bitshifts, but they are such cheap operations (free on the arm in some situations it seems) that thay are still incredibly useful.

This may be a dumb question, but how do you lose accuracy with a bit shift compared to integer division/multiplication? Don't they both result in truncation of any fractional part of the result?

Div will give you a fraction, bitshift won't.
 
Last edited by a moderator:
Blah posted on Apr 9 2006 at 09:34 PM said:
Incarnate posted on Apr 8 2006 at 10:10 PM said:
You can lose accuracy too with larger bitshifts, but they are such cheap operations (free on the arm in some situations it seems) that thay are still incredibly useful.

This may be a dumb question, but how do you lose accuracy with a bit shift compared to integer division/multiplication? Don't they both result in truncation of any fractional part of the result?

Div will give you a fraction, bitshift won't.

No - they can if you reserve some lower meaning bits for that. And even hardware based fpu is truncating results all the time.
 
Last edited by a moderator:
Back
Top