pub struct Base { /* private fields */ }
Implementations§
Source§impl Base
impl Base
pub fn new(base: u32) -> Self
Sourcepub fn add_digits(&self, a: Digit, b: Digit) -> Pair
pub fn add_digits(&self, a: Digit, b: Digit) -> Pair
Given two digits, returns the digits of their sum in the form of (first_digit, carry_digit).
Sourcepub fn multiply_digits(&self, a: Digit, b: Digit) -> Pair
pub fn multiply_digits(&self, a: Digit, b: Digit) -> Pair
Given two digits, returns the digits of their product in the form of (first_digit, carry_digit).
pub fn digits_per_bucket(&self) -> usize
pub fn digit_width(&self) -> usize
pub fn digit_bitmask(&self) -> usize
Sourcepub fn bucket_index(&self, idx: usize) -> usize
pub fn bucket_index(&self, idx: usize) -> usize
Returns the index of a bucket within a vector of buckets, given the index of a digit
Sourcepub fn digit_index(&self, idx: usize) -> usize
pub fn digit_index(&self, idx: usize) -> usize
Returns the index of a digit within it’s respective bucket, given the index of a digit
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Base
impl RefUnwindSafe for Base
impl Send for Base
impl Sync for Base
impl Unpin for Base
impl UnwindSafe for Base
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