Source code for pow function?

Status
Not open for further replies.

hoangnc

Newbie level 4
Joined
May 10, 2004
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
57
pow source code

I have to write a function like pow (double pow(double x, double y)). Anyone has this source code?
 

pow function

pow is math function! In the standard library, there are his prototype!
 

pow function code

If You realy need ... You can use this fact:

X^Y <=> e^(ln(X^Y)) <=> e^(Y*ln(X))

PASCAL/DELPHI:

function Pow(aBasis: longint; aExponent: byte): longint;
begin Pow:=Trunc(Exp(aExponent*Ln(aBasis))); end;

Tihi 8)
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…