lol idk #1

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

View File

@ -3,7 +3,7 @@ use bnum::BInt;
use typenum::{Sum,Unsigned};
use std::marker::PhantomData;
#[derive(Clone,Copy,Debug)]
#[derive(Clone,Copy,Debug,Hash)]
pub struct Fixed<const CHUNKS:usize,Frac>{
bits:BInt<{CHUNKS}>,
frac:PhantomData<Frac>,
@ -28,6 +28,16 @@ impl<const CHUNKS:usize,Frac> PartialEq for Fixed<CHUNKS,Frac>{
}
impl<const CHUNKS:usize,Frac> Eq for Fixed<CHUNKS,Frac>{}
impl<const CHUNKS:usize,Frac> std::ops::Neg for Fixed<CHUNKS,Frac>{
type Output=Self;
fn neg(self)->Self{
Self{
bits:self.bits.neg(),
frac:PhantomData,
}
}
}
macro_rules! impl_operator {
( $struct: ident, $trait: ident, $method: ident, $output: ty ) => {
impl<const CHUNKS:usize,Frac> core::ops::$trait<$struct<CHUNKS,Frac>> for $struct<CHUNKS,Frac>{