RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
System.Exp Function

Returns the exponential of X.

Pascal
function Exp(X: Real): Real;
function Exp(const X: Extended): Extended;
C++
Real Exp(Real X);
Extended Exp(const Extended X);

System

In Delphi code, Exp returns the value of e raised to the power of X, where e is the base of the natural logarithms.  

Delphi Examples: 

 

{
This example calculated the exponential of 1.0 and then calculates
the natural log of that quantity to show that the natural log
function is the inverse of the exponential function.
}
procedure TForm1.Button1Click(Sender: TObject);
var
   e : real;
   S : string;
begin
   e := Exp(1.0);
   Str(ln(e):3:2, S);
   S := 'e = ' + FloatToStr(e) + '; ln(e) = ' + S;
   Canvas.TextOut(10, 10, S);
end;

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!