pub struct BigInt { /* private fields */ }Implementations§
Source§impl BigInt
impl BigInt
pub fn new(value: i64) -> Self
pub fn from_string(s: &str) -> Option<Self>
pub fn from_bytes_be(sign: Sign, bytes: &[u8]) -> Self
pub fn to_bytes_be(&self) -> (Sign, Vec<u8>)
pub fn abs(&self) -> Self
pub fn sign(&self) -> Sign
pub fn is_zero(&self) -> bool
pub fn is_positive(&self) -> bool
pub fn is_negative(&self) -> bool
pub fn pow(&self, exp: u32) -> Self
pub fn sqrt(&self) -> Option<Self>
pub fn gcd(&self, other: &Self) -> Self
pub fn lcm(&self, other: &Self) -> Self
pub fn mod_pow(&self, exp: &Self, modulus: &Self) -> Self
pub fn mod_inv(&self, modulus: &Self) -> Option<Self>
pub fn factorial(&self) -> Option<Self>
pub fn is_prime(&self) -> bool
pub fn next_prime(&self) -> Self
pub fn bit_length(&self) -> usize
pub fn count_ones(&self) -> u64
pub fn trailing_zeros(&self) -> Option<u64>
pub fn is_power_of_two(&self) -> bool
pub fn next_power_of_two(&self) -> Self
Trait Implementations§
Source§impl Ord for BigInt
impl Ord for BigInt
Source§impl PartialOrd for BigInt
impl PartialOrd for BigInt
impl Eq for BigInt
impl StructuralPartialEq for BigInt
Auto Trait Implementations§
impl Freeze for BigInt
impl RefUnwindSafe for BigInt
impl Send for BigInt
impl Sync for BigInt
impl Unpin 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