diff --git a/converter.py b/converter.py index c0478c3..6d65912 100644 --- a/converter.py +++ b/converter.py @@ -3,7 +3,7 @@ def decToBin(decIn): ret = "" twoMult = int(1) currentTwoPwr = int(0) - while ans != 0: + while ans > 0: ''' sleep(0.1) print("TwoMult = " + str(twoMult)) @@ -22,6 +22,10 @@ def decToBin(decIn): currentTwoPwr -= 1 twoMult = 2 ** currentTwoPwr + while (currentTwoPwr >= 0): + ret += "0" + currentTwoPwr -= 1 + return int(ret) def binToDec(binIn):