Question.7
A developer uses this function to check if a buffer size is a power of two:
int is_power_of_two(uint32_t n) { return (n & (n - 1)) == 0; }
He calls is_power_of_two(0). What does it return?
is_power_of_two(0)
Select Answer
0 (false) — 0 is not a power of two
1 (true) — the function incorrectly reports 0 as a power of two
Undefined behavior — (0 - 1) causes unsigned underflow