pub fn get_common_difference(term: f32, previous_term: f32) -> f32
Expand description

Returns the common difference between two terms of an arithmetic progression

§Arguments

  • term - Any term of the AP
  • previous_term - The term before term

§Examples

use ariprog;
let common_diff = ariprog::get_common_difference(10.0, 5.0); // Should return 5
let cd = ariprog::get_common_difference(12.0, 2.0); // should return 10