Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP数字加法错误_Php - Fatal编程技术网

PHP数字加法错误

PHP数字加法错误,php,Php,我想对数字1.000000+0或1.000000+1.000000进行汇总,但是当我进行收集时,我得到了上面的结果。我哪里做错了?我解决了这个问题。这对打电话的人很有帮助 $score = $_GET['score']; $ht = $ayarcek['total']; $total = $ht+$score; echo $total; Result: 6.0E-8 你的号码没有“错”。这就是所谓的科学记数法,是一种表示大小数字的方法。 $score = $_GET['score']; $h

我想对数字1.000000+0或1.000000+1.000000进行汇总,但是当我进行收集时,我得到了上面的结果。我哪里做错了?我解决了这个问题。这对打电话的人很有帮助

$score = $_GET['score'];
$ht = $ayarcek['total'];
$total = $ht+$score;
echo $total;

Result: 6.0E-8

你的号码没有“错”。这就是所谓的科学记数法,是一种表示大小数字的方法。
$score = $_GET['score'];
$ht = $ayarcek['total'];
$cek = $ht+$score;
$total = sprintf('%.8f', $cek);