GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


Return Highest Power of 2 by DELTRON
int highestbit(int x)
{
    int i=1<<7;
    while (i) { if (x&i) return i; i>>=1;}
    return 0;
}