问题描述
嘿!
我有3个变量:
$ avegagrpsalj(这个值为22,20)
$ avegagrpinkop(这个值为22,76)
$ avegagrpskop(在下面的公式之后得到-2,46的值):
--------------------------(22,2)---------- ----(22,76)-----------(22,2)
$ avegagrpskop =(($ avegagrpsalj - $ avegagrpinkop)/ $ avegagrpinkop)* 100 ;
如果我在计算器上这样做:
((22,2-22,76) )/ 22,76)* 100 = -2,46
我知道变量avegagrpsalj& avegagrpinkop有正确的值,因为我最后这样做:
Hey!
I got 3 variables:
$avegagrpsalj (this has a value of 22,20)
$avegagrpinkop (this has a value of 22,76)
$avegagrpskop (this should get a value of -2,46 after the following equation):
--------------------------(22,2)--------------(22,76)-----------(22,2)
$avegagrpskop = (($avegagrpsalj - $avegagrpinkop)/$avegagrpinkop)*100;
If I do it on my calculator:
((22,2-22,76)/22,76)*100= -2,46
I know the variables avegagrpsalj & avegagrpinkop have the right values because I do this at the end:
echo $avegagrpsalj;
echo "<br>";
echo $avegagrpinkop;
echo "<br>";
echo $avegagrpskop;
这样可以将$ avegagrpskop的值显示为-3,34而不是-2,46。我想不通为什么? :S
This keeps showing the value of $avegagrpskop to -3,34 instead of -2,46. I can't figure out why? :S
推荐答案
这篇关于方程不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!