Star rating, implementing Wilson score interval
问题 class Rating { public static function ratingAverage($positive, $total, $power = '0.05') { if ($total == 0) return 0; $z = Rating::pnormaldist(1-$power/2,0,1); $p = 1.0 * $positive / $total; $s = ($p + $z*$z/(2*$total) - $z * sqrt(($p*(1-$p)+$z*$z/(4*$total))/$total))/(1+$z*$z/$total); return $s; } public static function pnormaldist($qn) { $b = array( 1.570796288, 0.03706987906, -0.8364353589e-3, -0.2250947176e-3, 0.6841218299e-5, 0.5824238515e-5, -0.104527497e-5, 0.8360937017e-7, -0