FUNCTION Power(a,n : Real) : Real;
(* LITE VERSION *)
BEGIN
  Power := Exp(n * Ln(a))
END; (* Power, 'lite' version *)


FUNCTION Power (x : Real; n : Real) : Real;
(* PRO VERSION *)

  FUNCTION Pwr(n : Integer) : Real;
  BEGIN (* Recursive Pwr function *)
    IF n = 1 THEN 
      Pwr := x
    ELSE IF Odd(n) THEN
      Pwr := Sqr(Pwr(n DIV 2)) * x
    ELSE
      Pwr := Sqr(Pwr(n DIV 2))
  END;(* Pwr *)

BEGIN (* Power *)
  IF x = 0 THEN
    Power :=0
  ELSE IF n = 0 THEN
    Power := 1
  ELSE IF Frac(n) <> 0 THEN
      Power := Exp(n * Ln(x))
  ELSE IF n < 0 THEN
    Power := 1/Pwr(-Trunc(n))
  ELSE
    Power := Pwr(Trunc(n))
END;(* Power *)
