DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
next power of 2 python
def next_power_of_2(x): return 1 if x == 0 else 2**(x - 1).bit_length()
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#power
#python
ADD COMMENT
Topic
COMMENT
Name
7+1 =
Submit