Function fast_midpoint

Source
pub fn fast_midpoint<R>(a: R, b: R) -> R
where R: Copy + Add<R, Output = R> + Div<R, Output = R> + One,
Expand description

This is a faster version of f32::midpoint which doesn’t handle overflow.

assert_eq!(fast_midpoint(1.0, 5.0), 3.0);