How to use exponent in Pascal?

Asked

Viewed 1,306 times

1

I have a problem to solve, where the PG formula uses exponent other than two (squared), and cannot use sqrt().

How can I resolve this in Pascal in an intuitive way? I know you can’t use it ** also.

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

  • See if the documentation can help you in this case. Mount a script and anything we’re here to help. Hug!

2 answers

2

1

x 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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.