pub struct BigInt {
pub sign: bool,
pub digits: Vec<u8>,
}Fields§
§sign: bool§digits: Vec<u8>Implementations§
Source§impl BigInt
impl BigInt
pub fn zero() -> Self
pub fn one() -> Self
pub fn from_i64(val: i64) -> Self
pub fn to_i64(&self) -> Option<i64>
pub fn from_string(s: &str) -> Option<Self>
pub fn from_str_radix(s: &str, radix: u32) -> Option<Self>
pub fn is_zero(&self) -> bool
fn trim_leading_zeros(&mut self)
fn cmp_abs(a: &[u8], b: &[u8]) -> Ordering
pub fn add(&self, other: &Self) -> Self
pub fn sub(&self, other: &Self) -> Self
fn add_abs(a: &[u8], b: &[u8]) -> Vec<u8>
fn sub_abs(a: &[u8], b: &[u8]) -> Vec<u8>
pub fn mul(&self, other: &Self) -> Self
pub fn div_rem(&self, other: &Self) -> Option<(Self, Self)>
pub fn gcd(&self, other: &Self) -> Self
pub fn lcm(&self, other: &Self) -> Self
pub fn to_string(&self) -> String
Trait Implementations§
impl Eq for BigInt
Source§impl Ord for BigInt
impl Ord for BigInt
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Auto Trait Implementations§
impl Freeze for BigInt
impl RefUnwindSafe for BigInt
impl Send for BigInt
impl Sync for BigInt
impl Unpin for BigInt
impl UnsafeUnpin for BigInt
impl UnwindSafe for BigInt
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.