Skip to main content

position_gain

Function position_gain 

Source
pub fn position_gain(before: f64, after: f64) -> f64
Expand description

Change in position between two periods, positive when the position improved.

Positions count downwards (1 is best), so an improvement from 9.0 to 4.0 is reported as +5.0 rather than -5.0.

assert_eq!(serp_ctr::position_gain(9.0, 4.0), 5.0);
assert_eq!(serp_ctr::position_gain(4.0, 9.0), -5.0);