a) (v | (v + 1)) == 0;
b) (~v & (v – 1)) == 0;
c) (v | (v – 1)) == 0;
d) (v & (v – 1)) == 0;
Which of these expressions will return true if the input integer v is a power of two?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Which of these expressions will return true if the input integer v is a power of two?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!