mutils 12.7.0

Mathematical-like utilities. Points, Sizes, Colours, maths operating on them. Things like that.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::num::Num;
use crate::num::ToRounded;

pub trait FromRounded<N> {
    fn from_rounded(n: N) -> Self;
}

impl<N> FromRounded<f32> for N
where
    N: Num,
    f32: ToRounded<N>,
{
    #[inline(always)]
    fn from_rounded(o: f32) -> N {
        ToRounded::<N>::to_rounded(o)
    }
}