functionpowerInt

Computes the power x^n for the real x and the integer n.

Extends from Modelica.Icons.Function (Icon for functions).

Information

"A simple implementation of Algorithm A from section 4.6.3 of TAOCP" as taken from:

http://alvaro-videla.com/2014/03/the-power-algorithm.html

"There’s a very well known algorithm for calculation powers, that is x to the power of n or simply: x^n. Donald Knuth presents the algorithm in section 4.6.3 Evaluation of Powers of TAOCP."

  • 2017-11-14 by Peter Matthes:
    Implemented

Inputs

TypeNameDefaultDescription
Realxbase
Integernexponent

Outputs

TypeNameDefaultDescription
Realyresult