cfx_math/nth_root/
const_generic.rs

1use 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
18// impl<N> RootParam for N where N: Unsigned
19//         + IsGreater<U1, Output = True>
20//         + Sub<U1>
21//         + IsLessOrEqual<U12, Output = True>
22//         + SubU1
23// {
24//
25// }
26
27pub 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}