diff options
Diffstat (limited to 'progs/a530.py')
-rw-r--r-- | progs/a530.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/progs/a530.py b/progs/a530.py new file mode 100644 index 0000000..fb9221a --- /dev/null +++ b/progs/a530.py @@ -0,0 +1,8 @@ +def next_Power_Of_2(n):
+ count = 0;
+ if (n and not(n & (n - 1))):
+ return n
+ while( n != 0):
+ n >>= 1
+ count += 1
+ return 1 << count;
\ No newline at end of file |