Water-E:
为什么在DELPHI里面使用double类型会比single速度快???
[阅读: 1968] 2004-10-12 05:54:58
var
// f,f1:single;
f,f1:double;
i,c:integer;
begin
c:= GetTickCount ;
for i := 0 to 1000000 do
//if f=f1 then Continue;
f:=f+f1;
Caption := inttostr(GetTickCount -c);
执行 f=f1 时:
single用时740
double用时500
执行f:=f+f1时:
single用时400
double用时500
嘿嘿