Skip to content

Update binary_to_decimal.rb, create decimal_to_binary.rb and decimal_to_binary_test.rb#27

Open
beauttie wants to merge 3 commits intoAda-C14:masterfrom
beauttie:master
Open

Update binary_to_decimal.rb, create decimal_to_binary.rb and decimal_to_binary_test.rb#27
beauttie wants to merge 3 commits intoAda-C14:masterfrom
beauttie:master

Conversation

@beauttie
Copy link

Binary and Decimal

Congratulations! You're submitting your assignment.

Copy link
Collaborator

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, you hit the learning goals here and also got the decimal to binary method!

# The least significant bit is at index of the array's length minus 1.
# Calculate and return the binary value for this decimal number using
# the algorithm you devised in class.
def decimal_to_binary(decimal_num)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -5,5 +5,8 @@
# Calculate and return the decimal value for this binary number using
# the algorithm you devised in class.
def binary_to_decimal(binary_array)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants