lib/maths.c
unsigned int pk_next2pow(unsigned int num)
{
    if (num == 0)
        return 2;

    size_t count = 0;
    while (num != 0) {
        num >>= 1;
        count++;
    }

    return count;
}
// find the next power of 2 of a given number
find the next power of 2 of a given number
find the next power of 2 of a given number
unsigned int pk_next2pow(unsigned int num)
{
    if (num == 0)
        return 2;
    size_t count = 0;
    while (num != 0) {
        num >>= 1;
        count++;
    }
    return count;
}
unsigned int pk_next2pow ( unsigned int num ) { if ( num == 0 ) return 2 ; size_t count = 0 ; while ( num != 0 ) { num >>= 1 ; count ++ ; } return count ; }
find the next power of 2 of a given number
find the next power of 2 of a given number