How to use exponent in Pascal?

1

I have a problem to solve, where in the PG formula you use an exponent other than two (squared), and can not use sqrt() .

How can I solve this in Pascal in an intuitive way? I know you can not use ** either.

Formula: an = a1 . q(n – 1) // q elevado à n -1

    
asked by anonymous 19.08.2017 / 06:55

2 answers

1
an = a1 * power(q, n – 1)

Documentation .

    
19.08.2017 / 14:13
0

x raised to y is equal to exp (y * ln (x))

Example:

Program Exemplo;
var
a, b : Integer;
begin
  a := 5;
  b := 3;
  writeln (exp(b*ln(a)):10:0);
  readln;
end.
    
22.08.2017 / 16:06