Jun 3, 2004 #1 H 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 source code I have to write a function like pow (double pow(double x, double y)). Anyone has this source code?
Jun 3, 2004 #2 C clivechen Member level 3 Joined May 29, 2004 Messages 65 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,288 Activity points 500 pow function pow is math function! In the standard library, there are his prototype!
Jun 4, 2004 #3 T Tihi Newbie level 6 Joined Mar 2, 2004 Messages 11 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 115 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)
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)