/操作的返回值为realvar
    temp1,temp2:ulong;
    Temp:Real;
begin
  temp:=temp1/temp2;  //  <--------此处编译通不过,怎么办?
end;

解决方案 »

  1.   


      temp:=Round(temp1/temp2);
      

  2.   

    问题是temp我必须设成整数,结果得到temp1/temp2的整数部分,能不能用类似C语言的强制类型转化的东西temp:=ulong(temp1/temp2) <--我试了,不行,如何达到这种效果?
      

  3.   

    不好意思,这个ulong是什么?
    如果是求商,用div()函数能不能满足需要
      

  4.   

    既然你只要整数部份,那就这样好了。
    temp := temp1 div temp2;
      

  5.   

    var
        temp,temp1,temp2:ulong;
    begin
        ...
        temp:=temp1 div temp2;  
        ...
    end;