var
temp:int64;
j:integer;
y:int64;
begin
 temp:=strtoint64('$'+'666696C0');
        label1.Caption:=inttostr(temp);
        y:=temp;
        j:=y/(65536*128);
end;报错[Error] Unit1.pas(44): Incompatible types: 'Integer' and 'Extended'
如何解决,谢谢

解决方案 »

  1.   

    我就要j是整数,我用了j:=int(y/(65536*128))也不行
      

  2.   

    一语提醒梦中人。再请教
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Edit1: TEdit;
        Button1: TButton;
        Label1: TLabel;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var
    temp:int64;
    k:Extended;
    z:Extended;
    y:int64;
    x:double;
    j:integer;
    i:integer;
    begin
            temp:=strtoint64('$'+'666696C0');
            label1.Caption:=inttostr(temp);
            y:=temp;
            k:=0;
            i:=0;
            j:=y div (65536*128);
            z:=((2*y)mod(65536*256))/2;
            if(j>=127) then begin
            for i:=1 to (j-127) do begin
            x:=x*2
              end;
            end
            else begin
            for i:=1 to (127-j)do begin
            x:=x/2 ;
            end;
            z:=z*2;k:=1;
            for i:=1 to 23 do begin
            k:=k*2;
            x:=x+1/k;
            z:=z*2;
            end;
            x:=x*Z/64;
            edit1.text:=floattostr(x);        end;end;end.
    运行上一段程序时,edit1的text好象没有变化,为什么?
    另外,可否请教如何取一个数化为二进制时的某个特定的位