cfx_math/nth_root/
const_generic.rs1use std::ops::{Add, Mul, Sub};
2
3use super::RootDegree;
4use typenum::*;
5
6pub trait SubU1 {
7 type Output: Unsigned;
8}
9
10impl<T> SubU1 for T
11where
12 T: Sub<U1>,
13 <T as Sub<U1>>::Output: Unsigned,
14{
15 type Output = <T as Sub<U1>>::Output;
16}
17
18pub trait RootInvParams {}
28
29impl<N: RootDegree, P: Unsigned> RootInvParams for (N, P)
30where
31 P: Unsigned + Add<U1>,
32 N: RootDegree + Mul<<P as Add<U1>>::Output>,
33 <N as Mul<<P as Add<U1>>::Output>>::Output:
34 IsLessOrEqual<U256, Output = True>,
35{
36}