找了很久不知如何写。
帮帮忙。

解决方案 »

  1.   

    Power函数!!!也可以自己写一个递归函数!!!
      

  2.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls,Math;type
      TForm1 = class(TForm)
        Button1: TButton;
        Button2: TButton;
        Label1: TLabel;
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button2Click(Sender: TObject);
    var i :double ;
    begin
      Button1.SetFocus ;
      i:= Power(2.4,5);
      Label1.Caption := floatToStr(i);
    end;end.
      

  3.   

    邊乘的形式: 明显太慢,而且占空间;还不如先做log再加;
    delphi的手册都是这么可怜吧唧的用浮点运算来做的。
      

  4.   

    有个笨办法:用循环:
     for i:=1 to n do
        a:=a*a
    我想你的要求不会太高吧,一般的n方应该够用了吧,太高次你试试,可能会慢!