lighthouse_protocol/utils/rem_euclid.rs
1/// A type that supports Euclidean modulo.
2pub trait RemEuclid {
3 fn rem_euclid(self, rhs: Self) -> Self;
4}
5
6macro_rules! impl_rem_euclid {
7 ($($tys:ty),*) => {
8 $(impl RemEuclid for $tys {
9 fn rem_euclid(self, rhs: Self) -> Self {
10 <$tys>::rem_euclid(self, rhs)
11 }
12 })*
13 };
14}
15
16impl_rem_euclid!(
17 u8, u16, u32, u64, u128, usize,
18 i8, i16, i32, i64, i128, isize,
19 f32, f64
20);