Skip to content

Commit

Permalink
add_binary && sqrt
Browse files Browse the repository at this point in the history
  • Loading branch information
a-abdellatif98 committed Jun 9, 2022
1 parent 0cb10a4 commit 177060c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Add_Binary.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def add_binary(a, b)
return (a.to_i(2) + b.to_i(2)).to_s(2)
end

puts add_binary(11,1)
3 changes: 3 additions & 0 deletions sqrt.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def my_sqrt(x)
return Math.sqrt(x).to_i
end

0 comments on commit 177060c

Please sign in to comment.