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

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

    return (1 << count);
}
// find the next power of 2 given a number
// and then raise it to the power of 2
find the next power of 2 given a number
and then raise it to the power of 2
find the next power of 2 given a number and then raise it to the power of 2
unsigned int pk_next2pow2(unsigned int num)
{
    if (num == 0)
        return 2;
    size_t count = 0;
    while (num != 0) {
        num >>= 1;
        count++;
    }
    return (1 << count);
}
unsigned int pk_next2pow2 ( unsigned int num ) { if ( num == 0 ) return 2 ; size_t count = 0 ; while ( num != 0 ) { num >>= 1 ; count ++ ; } return ( 1 << count ) ; }
find the next power of 2 given a number
and then raise it to the power of 2
find the next power of 2 given a number and then raise it to the power of 2