MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin / calculateException

Function calculateException

plugin/chess/elo.go:17–19  ·  view source on GitHub ↗
(rate int, opponentRate int)

Source from the content-addressed store, hash-verified

15}
16
17func calculateException(rate int, opponentRate int) float64 {
18 return 1.0 / (1.0 + math.Pow(10.0, float64(opponentRate-rate)/400.0))
19}
20
21func calculateRate(rate int, score float64, exception float64, k int) int {
22 newRate := int(math.Round(float64(rate) + float64(k)*(score-exception)))

Callers 2

calculateNewRateFunction · 0.85
Test_calculateExceptionFunction · 0.85

Calls

no outgoing calls

Tested by 1

Test_calculateExceptionFunction · 0.68