Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

average

Returns the average of two numbers. The result is rounded down.

Fully qualified path: openzeppelin_utils::math::average

pub fn average<
    T,
    impl TDrop: Drop<T>,
    impl TCopy: Copy<T>,
    impl TAdd: Add<T>,
    impl TDiv: Div<T>,
    impl TBitAnd: BitAnd<T>,
    impl TBitXor: BitXor<T>,
    impl TInto: Into<core::integer::u8, T>,
>(
    a: T, b: T,
) -> T