Aritmetica: potenza

Iterativa

MN = Pot(M, N) = M*M*...*M (N fattori)

Ricorsiva

  • M0 = 1, per N = 0
  • MN = M*MN-1, altrimenti

oppure

  • Pot(M, N) = 1, per N = 0
  • Pot(M, N) = M*Pot(M, N-1), altrimenti

Notice: This work is licensed under a BY-NC-SA. Permalink: Aritmetica: potenza

Comments are closed.