>Here's something else I found (accidently) : > >FOR j&=1 TO _numTrials > diffh=aPt.h% -bPt.h% > diffv= aPt.v% -bPt.v% > 'total1&=diffh*diffh:' need for speed 1 > total1&=diffh^2:' need for speed 2 >NEXT > >Since I am working out lengths, I need to take the number and mulitply it >by itself. So being a rather bright chappie that I think I am (okay humour >me), I just used ^2 after the variable. WRONG. I ran the timing test, or >rather started it, went and made coffee, came back, it was just about done. >Sheesh. > >So now, sitting and sipping coffee, I changed the line to be a boring, >simple var*var. The difference was incredible. The tick count barely >increased by 30% and thats in the 3 million cycles I was testing it at. >Methinks I shall avoid using the ^ exponentiation in future. > Hi Mel, Unless I'm mistaken (again), exponentiation is always a floating-point operation, meaning conversions, etc. Always better to stick with integer math when possible and appropriate. 0"0 =J= a y "