about | help | code help+videos | done | prefs |
Write a function power(base, exponent) that returns the value base^exponent, i.e. base * base * base * ... * base, where there are exponent many terms of the product. For example, 2^5 = 32 because 2*2*2*2*2 = 32. Do not assume base and exponent are integers. Raising a number to the power 1/2 is the same as taking its square root. power(2, 3) → 8 power(4, 0.5) → 2.0 power(4, 0) → 1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy