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:: No Line Numbers


next power of 2 by godecho
1
 
int nextPowerOf2(const int &a)
{
    static int rval = 1;
    while(rval < a)
    {
        rval<<=1;    // same as rval*=2
    }
    return rval;
}