Easy way out:Originally posted by bwkaz
Sure, just factor it.
for(i=0; i<31; i++) { /* these +'s don't count, do they? */
unsigned int i;
for (i = 4294967295; i; i >>= 1)
You'll get 32 shifts until i = 0, or 31 until i = 1, there's your counter.
|
Results 1 to 15 of 279
Thread: Programming ChallengesThreaded View
|
|