- - * - WhiteUnicorn - * - -




* #WhiteUnicorn/ StartPage/ Documentation/DelphiFAQ >


Frequently Asked Questions

How do I create a power function?

Question:

How do I create a power function?

Answer:

The following example shows how to use the example 

power function to raise three to the power of 2:



function Power(x, y : extended) : extended;

begin

  result := exp(y*ln(x));

end;



procedure TForm1.Button1Click(Sender: TObject);

begin

  ShowMessage(FloatToStr(Power(3, 2)));

end;



* #WhiteUnicorn/ StartPage/ Documentation/DelphiFAQ >



- - * - Anastasija aka WhiteUnicorn - * - - LJLiveJournal
PFPhotoFile