Building An Exponent Function
Lesson 24Author : GOUP
Last Updated : September, 2020
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