Re: Writing natural logarithmic expression in delphiPosted by webmaster Guido on May 12, 2003 at 16:51:30: In Reply to: Writing natural logarithmic expression in delphi posted by p12297 on May 12, 2003 at 14:45:44:
: I want to write this expression in delphi: : Thanks. The natural logarithm is given by Ln(X), not by Log(X). So you were very close :) procedure TForm1....; var X, Y, DF: real; ... begin ... DF := Ln(X) / Sqrt( Sqr(Ln(Y)) + Sqr(pi) ); ... end; Of course you're also allowed to write your own function, say "CalcDF": function CalcDF(X, Y: real): real; begin Result := Ln(X) / Sqrt( Sqr(Ln(Y)) + Sqr(pi) ); end; Now, if for example Z has been declared as "real", you can write: DF := CalcDF(X, Y); |
|