View Single Post
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-20-2009 , 04:27   Re: [INFO] Bitsums and Operators
Reply With Quote #20

Quote:
Originally Posted by joaquimandrade View Post
Your it's wrong because you are doing a continue instead of let the looping run. So you are calling 10 times the command and just giving 10 comparisons.
This A result from your code, I profiled it.. Read more carefully my post ;)

And I can't undersatand what u a saying about countinue. It let the loop run just makes i++.

and break stops the loop.




PHP Code:
#define AddFlag(%1,%2)       ( %1 |= ( 1 << (%2-1) ) )
#define RemoveFlag(%1,%2)    ( %1 &= ~( 1 << (%2-1) ) )
#define CheckFlag(%1,%2)     ( %1 & ( 1 << (%2-1) ) ) 
Wow that great! Thx
+k



but is this better?
PHP Code:
#define AddFlag(%1,%2)        ( %1 |= ( 1 << (%2 % 32) ) )
#define RemoveFlag(%1,%2)     ( %1 &= ~( 1 << (%2 % 32) ) )
#define CheckFlag(%1,%2)      ( %1 & ( 1 << (%2 % 32) ) ) 


And I have a question..
For example a have bitsum var.. 1230 and 4000 bit A true..

So should I loop thougth all to find them?? Or maybe there is better way

Last edited by Empowers; 04-20-2009 at 04:40.
Empowers is offline
Send a message via ICQ to Empowers