We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8904f03 commit f8c5ddbCopy full SHA for f8c5ddb
math/decimal_to_binary_converter.py
@@ -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
6
7
def dec_to_bin(n):
8
quo = n
@@ -13,4 +18,4 @@ def dec_to_bin(n):
13
18
return binary
14
19
15
20
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