Function skill_rating::elo::expected_score [] [src]

pub fn expected_score(r_a: EloRating, r_b: EloRating) -> f32

Calculates the expected outcome of a match between two players. This will always be a number between 0 and 1. The closer to 1 the more favored the match is for player a.

Example

Chance of a person winning

use skill_rating::elo;
 
let john = 1700;
let paul = 1800;

// Calculate johns chance to win against paul
let chance = elo::expected_score(john, paul) * 100_f32;