lighthouse_protocol/utils/
sqrt.rs

1/// A type whose values have a square root.
2pub trait Sqrt {
3    /// The square root.
4    fn sqrt(self) -> Self;
5}
6
7macro_rules! impl_sqrt {
8    ($($tys:ty),*) => {
9        $(impl Sqrt for $tys {
10            fn sqrt(self) -> Self {
11                <$tys>::sqrt(self)
12            }
13        })*
14    };
15}
16
17impl_sqrt!(
18    f32, f64
19);