Check if a Number is a Power of 2 in C#

added by DotNetKicks
5/9/2022 4:22:25 PM

206 Views

In this article, we are going to learn the most efficient and popular solutions to a very common problem - checking if a number is a power of 2. While it seems an easy task, we will see that some of these solutions are faulty in presence of corner cases.


0 comments