Reputation: 114
After some searching on the internet I'm yet to find the resource I need...I have, what I think, is a very simple question regarding math functions within PHP.
I'm computating an ELO function (for team rankings) and am unsure of what PHP math functions I use. Here is the math function: http://images.wikia.com/leagueoflegends/images/math/5/2/0/5209563cdf8a0d5b21ccc7c08d05c52b.png
I don't know how to formulate the math within PHP though. Any help is greatly appreciated...I'm pretty stuck. Doing basic division is not a problem, but I don't know how to slip in exponents.
If you need any more information please let me know.
Upvotes: 0
Views: 210
Reputation: 4748
Try this:
$Rb = 65; // Set these values according to your data
$Ra = 50;
$Ea = 1 / (1 + pow(10, ($Rb - $Ra)/400)) // $Ea will have the result
Check out PHP Math Functions for documentation on all math functions available in php.
Upvotes: 3