This commit is contained in:
mdecker62
2026-03-03 14:22:48 -05:00
parent 2db7bb51f5
commit d9ba2ef19c
1047 changed files with 205313 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
class BitsError(Exception):
message = "Bits error"
def __str__(self):
return self.message
class NotEnoughBits(BitsError):
def __init__(self, obj, length):
self.message = f"{obj} cannot fit into {length} bits."
class IntegersRequireLength(BitsError):
message = "Binary representations of integers require that a length be provided."
class IntegerAdditionRequiresSameLength(BitsError):
message = "Can only add integers of the same length."