calculator
calculator copied to clipboard
Simplify calculations of the nearest power of 2
Use compiler intrinsics to find the nearest power of 2 as quickly as possible.
In addition, handle the 0 case, so that the program does not become stuck in an infinite loop if iNum is 0.