Function add_times

Source
pub fn add_times<T, U>(b: T, a: T, p: U) -> T
where T: Sized + for<'x> AddAssign<&'x T> + for<'x> From<<&'x T as Add>::Output>, for<'x> &'x T: Add, U: Sized + Zero + One + Eq + for<'x> ShrAssign<usize> + for<'x> From<<&'x U as BitAnd>::Output>, for<'x> &'x U: BitAnd,
Expand description

calcurate $b + pa$ with mutliprecation by doubling

This function doesn’t require T: num_traits::Zero.

use ring_algorithm::add_times;
assert_eq!(add_times::<i32, u64>(3, 2, 7), 17);