在PHP++oracle里desc table不能用马?!
$liste = "desc table"; $statement_liste = OCIParse ($conn,...
作者 lijian0551 发布于 0000-00-00 分类:php基础编程
两整数相加,结果为什么是小数?
我将两个随机的整数相加,结果赋值给一个数组元素,显示处理的居然是小数?
这是咋的啦?是变量类型的问题吗?
求教各位。多谢!
逛论坛交流:两整数相加,结果为什么是小数?
>源码帖出来看看!
>$total=1;
while ($total <= 10){
$temp_para[$total][0]=mt_rand(1,10);
for ($i=1; $i < $parameter_num; $i++){
$temp_sign[$total][$i]=strval(mt_rand(1,4));
while (!strpos($sign,$temp_sign[$total][$i])) {$temp_sign[$total][$i]=strval(mt_rand(1,4));}
$temp_para[$total][$i]=mt_rand(1,10);
}
$answer[$total]=$temp[0];
for ($i=1; $i<=count($temp_sn); $i++){ if ($temp_sign[$i]=="1") {$answer[$total]+=$temp_para[$i];}
if ($temp_sign[$i]=="2") {$answer[$total]-=$temp_para[$i];}
}
代码我简化了一些,中间的变量我已经用常数代替了,$sign是选择的预算类型,就是加减乘除之类的。1加2减3乘4除的。
>没人指点吗?
还是问题太幼稚了?
>顶
>数据类型的问题。
5 条回复
回复