pub fn weighted_average<T>(
first_value: T,
first_weight: T,
second_value: T,
second_weight: T,
) -> TExpand description
Computes the weighted average of two values.
Returns (first_value * first_weight + second_value * second_weight) / (first_weight + second_weight).
ยงPanics
Panics on division by zero if both weights are zero.