Multiple choice technology databases

power(-5, 3) would return ?

  1. -15

  2. -125

  3. 125

  4. 15

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The power function raises a number to an exponent. power(-5, 3) means -5³ = -5 × -5 × -5 = -125. When raising a negative number to an odd power, the result stays negative. For even powers, the result becomes positive.