here for the next multiple of 8
i have 3 different solutions ...

1)...
        nextmultiple = (n/8+1)*8

2)...
        nextmultiple=  n+(8-n%8)

3)...
       suppose i have  32-bit compiler

       for(i=32; i>1; i--)
       {
              if((pow(2,i)&n==0)&&(pow(2,i-1)&n!=0))
              {
                               nextmultiple = pow(2,i);
                               break;
               }
       }

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to