Skip to content

Commit f8c5ddb

Browse files
authored
Add introductory comment
1 parent 8904f03 commit f8c5ddb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

math/decimal_to_binary_converter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""
2+
I came up with this algorithm to convert decimal(natural numbers only xd) to binary completely from scratch and
3+
therefore it might not be the best most efficient implementation.
4+
Optimizations are welcome.
5+
"""
16

27
def dec_to_bin(n):
38
quo = n
@@ -13,4 +18,4 @@ def dec_to_bin(n):
1318
return binary
1419

1520
for i in range(0,101):
16-
print("Decimal:"+str(i)+" Binary:"+str(dec_to_bin(i)))
21+
print("Natural Number:"+str(i)+" Binary:"+str(dec_to_bin(i)))

0 commit comments

Comments
 (0)