pub fn rescale_val( x: i64, from_min: i64, from_max: i64, to_min: i64, to_max: i64) -> i64
Rescale a given integer value from one range to another