中国开发网: 论坛: 程序员情感CBD: 贴子 31528
Water-E
为什么在DELPHI里面使用double类型会比single速度快???
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




嘿嘿

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录