Building An Exponent Function
Lesson 24Author : 🦒
Last Updated : November, 2017
Code
def pow(base_num, pow_num)
result = 1
pow_num.times do |index|
result = result * base_num
end
return result
end
def pow(base_num, pow_num)
result = 1
pow_num.times do |index|
result = result * base_num
end
return result
end