Jump to content

equation using e^


Stooney

Recommended Posts

I'm having a small problem with trying to get a script to run this particular calculation:

 

$points[2] = (2894/( 1+ 259 * e^(-0.0025 * $rating));

 

im sure the e^ is throwing it off, but im not sure how to go about it differently, im not any good at math.  thnx in advance for help.

 

Link to comment
https://forums.phpfreaks.com/topic/43509-equation-using-e/
Share on other sites

Here's the error im getting on that line:

 

Parse error: parse error, unexpected ';' in /homepages/45/d138243730/htdocs/arena/arena.php on line 12

 

full script:

 

<form action="arena.php" method="post">
Team Rating <input type="text" name="rating"><br>


<?php


if($rating!=""){

if($rating > 1500){
$points[2] = (2894/( 1+ 259 * exp(-0.0025 * $rating));
$points[0] = $points[2] * .6;
$points[1] = $points[2] * .8;
}

else{
$points[2] = (0.206*$rating+99);
$points[0] = $points[2] * .6;
$points[1] = $points[2] * .8;
}

echo "2v2 = $points[0] <br>";
echo "3v3 = $points[1] <br>";
echo "5v5 = $points[2] <br>";

}

?>

Link to comment
https://forums.phpfreaks.com/topic/43509-equation-using-e/#findComment-211305
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.