is-power-of-two

1.0.0 • Public • Published

is-power-of-two

frozen

Test whether a number is power of two.

var isPOT = require('is-power-of-two') 
 
isPOT(4)  === true
isPOT(16) === true
isPOT(10) === false

Usage

NPM

powerOfTwo(number)

If the given number is greater than 0 and a power of 2, returns true. Otherwise returns false.

See Also

License

MIT, see LICENSE.md for details.

Package Sidebar

Install

npm i is-power-of-two

Weekly Downloads

8

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mattdesl