LiuR[0]:=LiuP[0]/LiuS[0];
GeR[0]:=GeP[0]/GeS[0];
DaR[0]:=DaP[0]/DaS[0];
QinR[0]:=QinP[0]/QinS[0];
为什么除不了呢?我已经定义上诉的数组为real类型的,而‘/’的操作数要么为integer,要么为real,而且经‘/’操作之后的数据为real类型的。
运行时错误提示为:Project dianzhanxitong.exe raised exception class EZeroDivide with message
'Floating point division by zero'.process stopped.Use Step or Run to continue.上述数组的初值为:
LiuP[0]:=PLEVEL+random(100)/25;
GeP[0]:=PLEVEL+random(100)/25;
DaP[0]:=PLEVEL+random(100)/25;
QinP[0]:=PLEVEL+random(100)/25; LiuQ[0]:=QLEVEL+random(100)/10;
GeQ[0]:=QLEVEL+random(100)/10;
DaQ[0]:=QLEVEL+random(100)/10;
QinQ[0]:=QLEVEL+random(100)/10; LiuS[0]:=Sqrt(LiuP[0]*LiuP[0]+LiuQ[0]*LiuQ[0]);
GeS[0]:=Sqrt(GeS[0]*GeS[0]+GeS[0]*GeS[0]);
DaS[0]:=Sqrt(DaS[0]*DaS[0]+DaS[0]*DaS[0]);
QinS[0]:=Sqrt(QinS[0]*QinS[0]+QinS[0]*QinS[0]);其中PLEVEL和QLEVEL我已经附值为15,按道理应该不会有除数和被除数出现0的情况,但是怎么会有上述错误呢?
GeR[0]:=GeP[0]/GeS[0];
DaR[0]:=DaP[0]/DaS[0];
QinR[0]:=QinP[0]/QinS[0];
为什么除不了呢?我已经定义上诉的数组为real类型的,而‘/’的操作数要么为integer,要么为real,而且经‘/’操作之后的数据为real类型的。
运行时错误提示为:Project dianzhanxitong.exe raised exception class EZeroDivide with message
'Floating point division by zero'.process stopped.Use Step or Run to continue.上述数组的初值为:
LiuP[0]:=PLEVEL+random(100)/25;
GeP[0]:=PLEVEL+random(100)/25;
DaP[0]:=PLEVEL+random(100)/25;
QinP[0]:=PLEVEL+random(100)/25; LiuQ[0]:=QLEVEL+random(100)/10;
GeQ[0]:=QLEVEL+random(100)/10;
DaQ[0]:=QLEVEL+random(100)/10;
QinQ[0]:=QLEVEL+random(100)/10; LiuS[0]:=Sqrt(LiuP[0]*LiuP[0]+LiuQ[0]*LiuQ[0]);
GeS[0]:=Sqrt(GeS[0]*GeS[0]+GeS[0]*GeS[0]);
DaS[0]:=Sqrt(DaS[0]*DaS[0]+DaS[0]*DaS[0]);
QinS[0]:=Sqrt(QinS[0]*QinS[0]+QinS[0]*QinS[0]);其中PLEVEL和QLEVEL我已经附值为15,按道理应该不会有除数和被除数出现0的情况,但是怎么会有上述错误呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货