Trait Average
trait Average: Integer
Provides methods to compute the average of two integers, without overflows.
Required Methods
fn average_ceil(self: &Self, other: &Self) -> SelfReturns the ceiling value of the average of
selfandother. --⌈(self + other)/2⌉Examples
use Average; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!;fn average_floor(self: &Self, other: &Self) -> SelfReturns the floor value of the average of
selfandother. --⌊(self + other)/2⌋Examples
use Average; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!;
Implementors
impl<I> Average for I