lol idk #1

Open
Quaternions wants to merge 826 commits from StrafesNET/strafe-project:master into master
Showing only changes of commit c4a2778af1 - Show all commits

View File

@ -70,15 +70,22 @@ impl<const F:usize> Fixed<1,F>{
}
}
impl<const N:usize,const F:usize,T> From<T> for Fixed<N,F>
where
BInt<N>:From<T>
{
#[inline]
fn from(value:T)->Self{
Self::from_bits(BInt::<{N}>::from(value)<<F as u32)
}
macro_rules! impl_from {
($($from:ty),*)=>{
$(
impl<const N:usize,const F:usize> From<$from> for Fixed<N,F>{
#[inline]
fn from(value:$from)->Self{
Self::from_bits(BInt::<{N}>::from(value)<<F as u32)
}
}
)*
};
}
impl_from!(
u8,u16,u32,u64,u128,usize,
i8,i16,i32,i64,i128,isize
);
impl<const N:usize,const F:usize> PartialEq for Fixed<N,F>{
#[inline]