Delphi怎样判断除数为0

解决方案 »

  1.   

     不太明白  ?是直接判断 if 除数=0 then 吗
      

  2.   

    恩~!因为我是学JAVA的,Delphi和JAVA不一样~! num1:=strtofloat(Edit1.Text);
        num2:=strtofloat(Edit2.Text);
        if num2==0 then
            begin
                Label4.Caption:='除数不能为0';
            end
        else
            begin
                num3:=num1/num2;            Label4.Caption:=floattostr(num3);
            end;
    红色的地方怎么判断?
      

  3.   

    if num2 = 0 then delphi 用 = 表示 相等:= 用于赋值 
      

  4.   

    delphi判断相等时用 =  赋值是用 :=
    java               ==           =
      

  5.   

    int a,b;
    try{
    if(a/b)
    }
    catch{
      messageBox.show("除数为0或其它错误");
    }