# about a function of squre

i want to know which function can perform the following.

3^3 = 27, 3^4 = 81 and so on.
###### 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.

Commented:
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
Commented:
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
Commented:
0
Commented:
You can use
result := exp(exponent*ln(base));

where,
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