pub struct Bin<Id> {
pub exp: Lin<Id>,
}Expand description
Represents a type-level power of two (2^Lin)
Fields§
§exp: Lin<Id>Implementations§
Source§impl<T: Ord> Bin<T>
impl<T: Ord> Bin<T>
pub fn lit(a: u8) -> Self
pub fn var(v: T) -> Self
pub fn double(self) -> Selfwhere
T: Clone,
Sourcepub fn log2(u: i32) -> (Bin<T>, i32)
pub fn log2(u: i32) -> (Bin<T>, i32)
Logarithm with remainder ex: log2(9) = (3, 1) log(-129) = (7, -1)
Trait Implementations§
Source§impl<T: Ord + Clone> AddAssign<Bin<T>> for Dyadic<T>
impl<T: Ord + Clone> AddAssign<Bin<T>> for Dyadic<T>
Source§fn add_assign(&mut self, other: Bin<T>)
fn add_assign(&mut self, other: Bin<T>)
Performs the
+= operation. Read moreSource§impl<T: Ord + Clone> Div for &Bin<T>
Division of powers of two is equivalent to subtracting the exponents
impl<T: Ord + Clone> Div for &Bin<T>
Division of powers of two is equivalent to subtracting the exponents
Source§impl<T: Ord + Clone> Div for Bin<T>
Division of powers of two is equivalent to subtracting the exponents
impl<T: Ord + Clone> Div for Bin<T>
Division of powers of two is equivalent to subtracting the exponents
Source§impl<T: Ord> DivAssign<Bin<T>> for Dyadic<T>
Division of dyadic numbers by binary powers
impl<T: Ord> DivAssign<Bin<T>> for Dyadic<T>
Division of dyadic numbers by binary powers
Source§fn div_assign(&mut self, other: Bin<T>)
fn div_assign(&mut self, other: Bin<T>)
Performs the
/= operation. Read moreSource§impl<T: Ord + Clone> MulAssign<Bin<T>> for Dyadic<T>
impl<T: Ord + Clone> MulAssign<Bin<T>> for Dyadic<T>
Source§fn mul_assign(&mut self, other: Bin<T>)
fn mul_assign(&mut self, other: Bin<T>)
Performs the
*= operation. Read moreSource§impl<T: Ord> MulAssign<Bin<T>> for Mono<T>
Multiplication of monoterms to bin [normalizes]
impl<T: Ord> MulAssign<Bin<T>> for Mono<T>
Multiplication of monoterms to bin [normalizes]
Source§fn mul_assign(&mut self, other: Bin<T>)
fn mul_assign(&mut self, other: Bin<T>)
Performs the
*= operation. Read moreSource§impl<T: Ord> MulAssign for Bin<T>
Multiplication of powers of two is equivalent to adding the exponents
impl<T: Ord> MulAssign for Bin<T>
Multiplication of powers of two is equivalent to adding the exponents
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*= operation. Read moreSource§impl<Id: Ord> Ord for Bin<Id>
impl<Id: Ord> Ord for Bin<Id>
Source§impl<Id: PartialOrd> PartialOrd for Bin<Id>
impl<Id: PartialOrd> PartialOrd for Bin<Id>
Source§impl<'a, D, A, T> Pretty<'a, D, A> for Bin<T>
impl<'a, D, A, T> Pretty<'a, D, A> for Bin<T>
Source§fn pretty(self, allocator: &'a D) -> DocBuilder<'a, D, A>
fn pretty(self, allocator: &'a D) -> DocBuilder<'a, D, A>
Converts
self into a documentSource§impl<T: Ord + Display + Clone> Specializable<T, u8> for Bin<T>
Specialize a bin power by substituting a variable with a literal
impl<T: Ord + Display + Clone> Specializable<T, u8> for Bin<T>
Specialize a bin power by substituting a variable with a literal
Source§impl<T: Ord + Clone> SubAssign<Bin<T>> for Dyadic<T>
impl<T: Ord + Clone> SubAssign<Bin<T>> for Dyadic<T>
Source§fn sub_assign(&mut self, other: Bin<T>)
fn sub_assign(&mut self, other: Bin<T>)
Performs the
-= operation. Read moreimpl<Id: Eq> Eq for Bin<Id>
impl<Id> StructuralPartialEq for Bin<Id>
Auto Trait Implementations§
impl<Id> Freeze for Bin<Id>
impl<Id> RefUnwindSafe for Bin<Id>where
Id: RefUnwindSafe,
impl<Id> Send for Bin<Id>where
Id: Send,
impl<Id> Sync for Bin<Id>where
Id: Sync,
impl<Id> Unpin for Bin<Id>
impl<Id> UnwindSafe for Bin<Id>where
Id: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more