Skip to content

Instantly share code, notes, and snippets.

@gar
Created November 27, 2010 11:19
Show Gist options
  • Save gar/717811 to your computer and use it in GitHub Desktop.
Save gar/717811 to your computer and use it in GitHub Desktop.
def add(m, n)
total = m
for i in 1..n do
total += 1
end
total
end
def exp(m, n)
total = 1
for i in 1..n do
total *= m
end
total
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment