pub fn fast_midpoint<R>(a: R, b: R) -> Rwhere R: Copy + Add<R, Output = R> + Div<R, Output = R> + One,
This is a faster version of f32::midpoint which doesn’t handle overflow.
f32::midpoint
assert_eq!(fast_midpoint(1.0, 5.0), 3.0);