.Net-Core

How to check if a number is a power of 2

How to check if a number is a power of 2

Present I wanted a elemental algorithm for checking if a figure is a powerfulness of 2 The algorithm wants to beryllium Elemental Accurate for immoderate ulong