Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

weighted_average

Calculates the weighted average of values.

Arguments

  • values - Array of values
  • weights - Array of weights (must match values length)

Returns

None if arrays differ in length or weights sum to zero

Fully qualified path: cairo_fp::f128::math::ratio::weighted_average

fn weighted_average(values: Span<Fixed>, weights: Span<Fixed>) -> Option<Fixed>