about a function of squre

i want to know which function can perform the following.

3^3 = 27, 3^4 = 81 and so on.
I don't know how to express my problem.  Please help me.  Thanks
HenryChangAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dbruntonCommented:
function chang(number, power : integer) : integer;
var
  temp, i : integer;
begin
 temp := 1;
 for i := 1 to power do
   temp := temp * number;
  chang := temp;
end;
0
psimaxCommented:
Function raisedToPower(const base,exponent:Extended):Extended;
begin
  raisedToPower:=exp(exponent*ln(base));
end;

or just plain:
exp(exponent*ln(base));

The offer much flexibility, they allow you to use any number type.  But, in order to use the Extended type (or any other real type; other than the one called 'Real') you must have 8086/80287 turned on.

For Borland Turbo Pascal 7.0 for DOS:
Under the 'Numeric processing' heading in 'Options | Compiler'.

If your computer does not have a numeric processor, make sure you also have 'Emulation' checked (should be next to '8086/80287'; also under 'Numeric Processing').

For more explaination, use 'Help|Index'.
0
bakry99Commented:
good answer
0
sumant032199Commented:
You can use
result := exp(exponent*ln(base));

where,
      result   - answer you want.
      exponent - 4 in 3^4
      base     - 3 in 3^4
You can use any type of variable like integer.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Pascal

From novice to tech pro — start learning today.