沃尔夫拉姆阿尔法表示将为以下公式提供正确的结果:
((0.0004954*($current^2))-((0.935*$current)+378.486))-
((0.0004954*($desired^2))-((0.935*$desired)+378.486));
但是当我在PHP中运行它时,它没有给出正确的答案,为什么?
$current = mysql_escape_string($_POST['current']);
$desired = mysql_escape_string($_POST['desired']);
$username = mysql_escape_string($_POST['username']);
$password = mysql_escape_string($_POST['password']);
$email = mysql_escape_string($_POST['email']);
$ip = $_SERVER["REMOTE_ADDR"];
$time = time();
$elo = $desired - $current;
if($current < 1200) {
$price = ($elo/100)*30;
} elseif($current < 1400) {
$price = ($elo/100)*35;
} elseif($current < 1901) {
$price = ((0.0004954*($current^2))-((0.935*$current)+378.486))-((0.0004954*($desired^2))-((0.935*$desired)+378.486));
}