pub fn times<T>(a: T, p: u64) -> T where
    T: Sized + Zero + for<'x> AddAssign<&'x T> + for<'x> From<<&'x T as Add>::Output>,
    for<'x> &'x T: Add
Expand description

calcurate $pa$ with mutliprecation by doubling

use ring_algorithm::times;
assert_eq!(times::<i32>(2, 16), 32);