highest power of 2 less than or equal to N code example Example: highest power of 2 less than or equal to N int p = (int)log2(n); return (int)pow(2, p);