I settled on:
unsigned int util_roundpower2(unsigned int u_power) { u_power = u_power-1; u_power |= u_power >> 1; u_power |= u_power >> 2; u_power |= u_power >> 4; u_power |= u_power >> 8; u_power |= u_power >> 16; u_power = u_power+1; return(u_power); }
No comments:
Post a Comment