<?php
$last_percent = 0;
$as = array("110.800002098083", "30", "36.1499996185303", "11", "13", "13.9899997711182", "74.5200042724609", "13.9899997711182");
$t = 304.46000552177;
foreach($as as $a) {
$last_percent += round($a*100/$t, 2);
}
var_dump( $last_percent);
$last_percent = 100 - $last_percent;
var_dump( $last_percent);
?>
为什么结果是 0.33000000000001?为什么它只发生在 100 和 99 上?如果我使用 $last_percent = 90 - $last_percent; 结果是-9.67