r
/
fifth
1
Fork 0

No longer need bitmanip

master
Joshua Potter 2015-06-05 20:47:24 -04:00
parent 5202d62498
commit 3917627234
1 changed files with 0 additions and 27 deletions

View File

@ -1,27 +0,0 @@
"""
@author: jrpotter
@date: June 5th, 2015
"""
def max_unsigned(bit_count):
"""
"""
return 2**bit_count - 1
def bits_of(value, size = 0):
"""
"""
base = bin(value)[2:]
if size > len(base):
return "{}{}".format("0" * (size - len(base)), base)
else:
return base
def cycle(itr, offset):
"""
"""
return itr[:offset] + itr[offset+1:]