A tip!<br>
<br>
If you want to divide, or multiply a number<br>
by a factor that equals n^2 e.g (1, 2, 4, 8, 16..)<br>
use SHL(SHiftLeft) for multiplication, and<br>
SHR(SHiftRight) for division.<br>
<br>
//-------<br>
int x = 12 >> 1; // x is now (12 / 1^2) = 6<br>
int x = 12 << 2; // x is now (12 * 2^2) = 48<br>
//-------<br>
<br>
REMEMBER! it's for int numbers =)<br>
(int)floatVar << x, should work though.<br>
<br>
<br>
SHR, and SHL can speed up programs SO! much..<br>
Trust me.<br>
Always try to get rid of the "*", and "/"<br>
You can use lookuptables with fixed-point math.<br>
//-----------<br>
<br>
float u = x/y * 1024 // x/y << 10<br>
long int z = u;<br>
printf("%f", (float)(u >> 10));<br>
<br>
//-----------<br>
try something like this.<br>
hope this stuff helps.<br>
<br>
<br>