From 446b0e3085ec40e4c994d5483ae4c4309d12d53a Mon Sep 17 00:00:00 2001 From: Vitor Oliveira Date: Sat, 6 Mar 2021 11:48:27 -0800 Subject: [PATCH] Update iterative_decimal_to_binary.rb --- maths/iterative_decimal_to_binary.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maths/iterative_decimal_to_binary.rb b/maths/iterative_decimal_to_binary.rb index 043f233..918a7d4 100644 --- a/maths/iterative_decimal_to_binary.rb +++ b/maths/iterative_decimal_to_binary.rb @@ -6,7 +6,7 @@ def decimal_to_binary(n) bin << n % 2 n = n / 2 end - return bin.reverse.join + bin.reverse.join end puts 'Binary value of 4 is ' + decimal_to_binary(4).to_s