pub struct Exponential<'a, B: Base> { /* private fields */ }Expand description
A representation of a bignum
The base is statically known while the exponent is dynamic. The mantissa is not guaranteed to have optimal encoding, i.e. it can have leading zero bytes.
The represented value is m * base.pow(exponent), where
m = mantissaforinverted == false, andm = -1 - mantissaforinverted = true.
Implementations§
Source§impl<'a, B: Base> Exponential<'a, B>
impl<'a, B: Base> Exponential<'a, B>
pub fn new(exponent: i128, mantissa: Cow<'a, [u8]>, inverted: bool) -> Self
Sourcepub fn make_static(self) -> Exponential<'static, B>
pub fn make_static(self) -> Exponential<'static, B>
Cut ties with possibly referenced byte slices, allocating if necessary
Trait Implementations§
Source§impl<'a, B: Clone + Base> Clone for Exponential<'a, B>
impl<'a, B: Clone + Base> Clone for Exponential<'a, B>
Source§fn clone(&self) -> Exponential<'a, B>
fn clone(&self) -> Exponential<'a, B>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a, B: Debug + Base> Debug for Exponential<'a, B>
impl<'a, B: Debug + Base> Debug for Exponential<'a, B>
Source§impl<'a, B: Hash + Base> Hash for Exponential<'a, B>
impl<'a, B: Hash + Base> Hash for Exponential<'a, B>
Source§impl<'a, B: PartialEq + Base> PartialEq for Exponential<'a, B>
impl<'a, B: PartialEq + Base> PartialEq for Exponential<'a, B>
impl<'a, B: Base> StructuralPartialEq for Exponential<'a, B>
Auto Trait Implementations§
impl<'a, B> Freeze for Exponential<'a, B>
impl<'a, B> RefUnwindSafe for Exponential<'a, B>where
B: RefUnwindSafe,
impl<'a, B> Send for Exponential<'a, B>where
B: Send,
impl<'a, B> Sync for Exponential<'a, B>where
B: Sync,
impl<'a, B> Unpin for Exponential<'a, B>where
B: Unpin,
impl<'a, B> UnwindSafe for Exponential<'a, B>where
B: UnwindSafe,
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