请问两个浮点型的数相减的结果怎么跟整型数比较?
var
i,j:real;
i;=strtofloat(edit1.text);
j:=strtofloat(edit2.text);
if(i-j)<>0 then //现在问题是:这不能判断
begin
...
end;
var
i,j:real;
i;=strtofloat(edit1.text);
j:=strtofloat(edit2.text);
if(i-j)<>0 then //现在问题是:这不能判断
begin
...
end;
i,j:real;
i;=strtofloat(edit1.text);
j:=strtofloat(edit2.text);
if i<>j then //这下可以了吧?
begin
...
end;
var
i,j:real;
begin
i:=strtofloat(edit1.text);
j:=strtofloat(edit2.text);
if trunc((i-j))=0 then //现在问题是:这不能判断
begin
showmessage('');
end;
end;
const s:array[boolean] of string=('equal to 0','not equal to 0');
begin
i:=1.2;
j:=3.2;
ShowMessage(s[i-j<>0]);
end;