pub struct Integer {
pub negative: bool,
pub limbs: Vec<u64>,
}Fields§
§negative: bool§limbs: Vec<u64>Implementations§
source§impl Integer
impl Integer
pub fn new(negative: bool, limbs: Vec<u64>) -> Integer
pub fn is_valid_index(&self) -> bool
pub fn is_valid_byte(&self) -> bool
pub fn as_usize(&self) -> usize
pub fn as_u8(&self) -> u8
pub fn rand_with_size(digits: usize, can_be_negative: bool) -> Integer
pub fn rand_with_limbs(limbs: usize, can_be_negative: bool) -> Integer
pub fn is_even(&self) -> bool
pub fn is_zero(&self) -> bool
pub fn is_one(&self) -> bool
pub fn normalize_sign(&mut self) -> &Self
pub fn from_bin(string: &str) -> Self
pub fn from_hex(string: &str) -> Self
pub fn from_radix(string: &str, radix: u32, limb_length: usize) -> Self
pub fn bin(&self) -> String
pub fn to_f64(&self) -> f64
Trait Implementations§
source§impl<'a> AddAssign<&'a Integer> for Integer
impl<'a> AddAssign<&'a Integer> for Integer
source§fn add_assign(&mut self, rhs: &Integer)
fn add_assign(&mut self, rhs: &Integer)
Performs the
+= operation. Read moresource§impl AddAssign for Integer
impl AddAssign for Integer
source§fn add_assign(&mut self, rhs: Integer)
fn add_assign(&mut self, rhs: Integer)
Performs the
+= operation. Read moresource§impl<'a> BitAndAssign<&'a Integer> for Integer
impl<'a> BitAndAssign<&'a Integer> for Integer
source§fn bitand_assign(&mut self, rhs: &Integer)
fn bitand_assign(&mut self, rhs: &Integer)
Performs the
&= operation. Read moresource§impl BitAndAssign for Integer
impl BitAndAssign for Integer
source§fn bitand_assign(&mut self, rhs: Integer)
fn bitand_assign(&mut self, rhs: Integer)
Performs the
&= operation. Read moresource§impl<'a> BitOrAssign<&'a Integer> for Integer
impl<'a> BitOrAssign<&'a Integer> for Integer
source§fn bitor_assign(&mut self, rhs: &Integer)
fn bitor_assign(&mut self, rhs: &Integer)
Performs the
|= operation. Read moresource§impl BitOrAssign for Integer
impl BitOrAssign for Integer
source§fn bitor_assign(&mut self, rhs: Integer)
fn bitor_assign(&mut self, rhs: Integer)
Performs the
|= operation. Read moresource§impl<'a> BitXorAssign<&'a Integer> for Integer
impl<'a> BitXorAssign<&'a Integer> for Integer
source§fn bitxor_assign(&mut self, rhs: &Integer)
fn bitxor_assign(&mut self, rhs: &Integer)
Performs the
^= operation. Read moresource§impl BitXorAssign for Integer
impl BitXorAssign for Integer
source§fn bitxor_assign(&mut self, rhs: Integer)
fn bitxor_assign(&mut self, rhs: Integer)
Performs the
^= operation. Read moresource§impl<'de> Deserialize<'de> for Integer
impl<'de> Deserialize<'de> for Integer
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> DivAssign<&'a Integer> for Integer
impl<'a> DivAssign<&'a Integer> for Integer
source§fn div_assign(&mut self, rhs: &Integer)
fn div_assign(&mut self, rhs: &Integer)
Performs the
/= operation. Read moresource§impl DivAssign for Integer
impl DivAssign for Integer
source§fn div_assign(&mut self, rhs: Integer)
fn div_assign(&mut self, rhs: Integer)
Performs the
/= operation. Read moresource§impl<'a> MulAssign<&'a Integer> for Integer
impl<'a> MulAssign<&'a Integer> for Integer
source§fn mul_assign(&mut self, rhs: &Integer)
fn mul_assign(&mut self, rhs: &Integer)
Performs the
*= operation. Read moresource§impl MulAssign for Integer
impl MulAssign for Integer
source§fn mul_assign(&mut self, rhs: Integer)
fn mul_assign(&mut self, rhs: Integer)
Performs the
*= operation. Read moresource§impl Ord for Integer
impl Ord for Integer
source§impl PartialEq for Integer
impl PartialEq for Integer
source§impl PartialOrd for Integer
impl PartialOrd for Integer
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl<'a> ShlAssign<&'a u64> for Integer
impl<'a> ShlAssign<&'a u64> for Integer
source§fn shl_assign(&mut self, rhs: &u64)
fn shl_assign(&mut self, rhs: &u64)
Performs the
<<= operation. Read moresource§impl ShlAssign<u64> for Integer
impl ShlAssign<u64> for Integer
source§fn shl_assign(&mut self, rhs: u64)
fn shl_assign(&mut self, rhs: u64)
Performs the
<<= operation. Read moresource§impl<'a> ShrAssign<&'a u64> for Integer
impl<'a> ShrAssign<&'a u64> for Integer
source§fn shr_assign(&mut self, rhs: &u64)
fn shr_assign(&mut self, rhs: &u64)
Performs the
>>= operation. Read moresource§impl ShrAssign<u64> for Integer
impl ShrAssign<u64> for Integer
source§fn shr_assign(&mut self, rhs: u64)
fn shr_assign(&mut self, rhs: u64)
Performs the
>>= operation. Read moresource§impl<'a> SubAssign<&'a Integer> for Integer
impl<'a> SubAssign<&'a Integer> for Integer
source§fn sub_assign(&mut self, rhs: &Integer)
fn sub_assign(&mut self, rhs: &Integer)
Performs the
-= operation. Read moresource§impl SubAssign for Integer
impl SubAssign for Integer
source§fn sub_assign(&mut self, rhs: Integer)
fn sub_assign(&mut self, rhs: Integer)
Performs the
-= operation. Read moreimpl Eq for Integer
impl StructuralPartialEq for Integer
Auto Trait Implementations§
impl RefUnwindSafe for Integer
impl Send for Integer
impl Sync for Integer
impl Unpin for Integer
impl UnwindSafe for Integer
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.