DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR CPP
number is a power of 2
bool IsPowerOfTwo(ulong x) { return (x != 0) && ((x & (x - 1)) == 0); }
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#number
#power
ADD COMMENT
Topic
COMMENT
Name
8+9 =
Submit