#[repr(transparent)]pub struct UBig(_);
Expand description
An unsigned arbitrary precision integer.
This struct represents an arbitrarily large unsigned integer. Technically the size of the integer is bounded by the memory size, but it’s enough for practical use on modern devices.
Parsing and printing
To create a UBig instance, there are three ways:
- Use predifined constants (e.g. UBig::ZERO, UBig::ONE).
- Use the literal macro
ubig!
defined in thedashu-macro
crate. - Parse from a string.
Parsing from either literal or string supports representation with base 2~36.
For printing, the UBig type supports common formatting traits (Display, Debug, LowerHex, etc.). Specially, printing huge number using Debug will conveniently omit the middle digits of the number, only print the least and most significant (decimal) digits.
// parsing
let a = UBig::from(408580953453092208335085386466371u128);
let b = UBig::from(0x1231abcd4134u64);
let c = UBig::from_str_radix("a2a123bbb127779cccc123", 32)?;
let d = UBig::from_str_radix("1231abcd4134", 16)?;
assert_eq!(a, c);
assert_eq!(b, d);
// printing
assert_eq!(format!("{}", UBig::from(12u8)), "12");
assert_eq!(format!("{:#X}", UBig::from(0xabcdu16)), "0xABCD");
if Word::BITS == 64 {
// number of digits to display depends on the word size
assert_eq!(
format!("{:?}", UBig::ONE << 1000),
"1071508607186267320..4386837205668069376"
);
}
Memory
Integers that fit in a DoubleWord will be inlined on stack and no heap allocation will be invoked. For large integers, they will be represented as an array of Words, and stored on heap.
Note that the UBig struct has a niche bit, therefore it can be used within simple enums with no memory overhead.
use core::mem::size_of;
assert_eq!(size_of::<UBig>(), size_of::<Option<UBig>>());
Implementations
sourceimpl UBig
impl UBig
sourcepub fn bit(&self, n: usize) -> bool
pub fn bit(&self, n: usize) -> bool
Returns true if the n
-th bit is set, n starts from 0.
Examples
assert_eq!(UBig::from(0b10010u16).bit(1), true);
assert_eq!(UBig::from(0b10010u16).bit(3), false);
assert_eq!(UBig::from(0b10010u16).bit(100), false);
sourcepub fn set_bit(&mut self, n: usize)
pub fn set_bit(&mut self, n: usize)
Set the n
-th bit, n starts from 0.
Examples
let mut a = UBig::from(0b100u8);
a.set_bit(0);
assert_eq!(a, UBig::from(0b101u8));
a.set_bit(10);
assert_eq!(a, UBig::from(0b10000000101u16));
sourcepub fn clear_bit(&mut self, n: usize)
pub fn clear_bit(&mut self, n: usize)
Clear the n
-th bit, n starts from 0.
Examples
let mut a = UBig::from(0b101u8);
a.clear_bit(0);
assert_eq!(a, UBig::from(0b100u8));
sourcepub fn trailing_zeros(&self) -> Option<usize>
pub fn trailing_zeros(&self) -> Option<usize>
Returns the number of trailing zeros in the binary representation.
In other words, it is the largest n
such that 2 to the power of n
divides the number.
For 0, it returns None
.
Examples
assert_eq!(UBig::from(17u8).trailing_zeros(), Some(0));
assert_eq!(UBig::from(48u8).trailing_zeros(), Some(4));
assert_eq!(UBig::from(0b101000000u16).trailing_zeros(), Some(6));
assert_eq!(UBig::ZERO.trailing_zeros(), None);
sourcepub fn bit_len(&self) -> usize
pub fn bit_len(&self) -> usize
Bit length.
The length of the binary representation of the number.
For 0, the length is 0.
For non-zero numbers it is:
in_radix(2).to_string().len()
- the index of the top 1 bit plus one
- the floor of the logarithm base 2 of the number plus one.
Examples
assert_eq!(UBig::from(17u8).bit_len(), 5);
assert_eq!(UBig::from(0b101000000u16).bit_len(), 9);
assert_eq!(UBig::ZERO.bit_len(), 0);
let x = UBig::from(0x90ffff3450897234u64);
assert_eq!(x.bit_len(), x.in_radix(2).to_string().len());
sourcepub fn split_bits(self, n: usize) -> (UBig, UBig)
pub fn split_bits(self, n: usize) -> (UBig, UBig)
Split this integer into low bits and high bits.
Its returns are equal to (self & ((1 << n) - 1), self >> n)
.
Examples
let (lo, hi) = UBig::from(0b10100011u8).split_bits(4);
assert_eq!(hi, UBig::from(0b1010u8));
assert_eq!(lo, UBig::from(0b0011u8));
let x = UBig::from(0x90ffff3450897234u64);
let (lo, hi) = x.clone().split_bits(21);
assert_eq!(hi, (&x) >> 21);
assert_eq!(lo, x & ((UBig::ONE << 21) - 1u8));
sourcepub fn clear_high_bits(&mut self, n: usize)
pub fn clear_high_bits(&mut self, n: usize)
Clear the high bits from (n+1)-th bit.
This operation is equivalent to getting the lowest n bits on the integer
i.e. self &= ((1 << n) - 1)
.
Examples
let mut x = UBig::from(0b10100011u8);
x.clear_high_bits(4);
assert_eq!(x, UBig::from(0b0011u8));
let mut x = UBig::from(0x90ffff3450897234u64);
let lo = (&x) & ((UBig::ONE << 21) - 1u8);
x.clear_high_bits(21);
assert_eq!(x, lo);
sourceimpl UBig
impl UBig
sourcepub fn from_le_bytes(bytes: &[u8]) -> UBig
pub fn from_le_bytes(bytes: &[u8]) -> UBig
sourcepub fn from_be_bytes(bytes: &[u8]) -> UBig
pub fn from_be_bytes(bytes: &[u8]) -> UBig
sourcepub fn to_le_bytes(&self) -> Vec<u8>
pub fn to_le_bytes(&self) -> Vec<u8>
Return little-endian bytes.
Examples
assert!(UBig::ZERO.to_le_bytes().is_empty());
assert_eq!(UBig::from(0x010203u32).to_le_bytes(), [3, 2, 1]);
sourcepub fn to_be_bytes(&self) -> Vec<u8>
pub fn to_be_bytes(&self) -> Vec<u8>
Return big-endian bytes.
Examples
assert!(UBig::ZERO.to_be_bytes().is_empty());
assert_eq!(UBig::from(0x010203u32).to_be_bytes(), [1, 2, 3]);
sourcepub fn to_f32(&self) -> Approximation<f32, Sign>
pub fn to_f32(&self) -> Approximation<f32, Sign>
Convert to f32.
Round to nearest, breaking ties to even last bit. The returned approximation
is exact if the integer is exactly representable by f32, otherwise the error
field of the approximation contains the sign of result - self
.
Examples
assert_eq!(UBig::from(134u8).to_f32().value(), 134.0f32);
sourcepub fn to_f64(&self) -> Approximation<f64, Sign>
pub fn to_f64(&self) -> Approximation<f64, Sign>
Convert to f64.
Round to nearest, breaking ties to even last bit. The returned approximation
is exact if the integer is exactly representable by f64, otherwise the error
field of the approximation contains the sign of result - self
.
Examples
assert_eq!(UBig::from(134u8).to_f64().value(), 134.0f64);
sourceimpl UBig
impl UBig
sourcepub fn ilog(&self, base: &UBig) -> usize
pub fn ilog(&self, base: &UBig) -> usize
Calculate the (truncated) logarithm of the UBig
This function could takes a long time when the integer is very large. In applications where an exact result is not necessary, log2_bounds could be used.
Panics
Panics if the number is 0, or the base is 0 or 1
Examples
let base = UBig::from(3u8);
assert_eq!(UBig::from(81u8).ilog(&base), 4);
assert_eq!(UBig::from(1000u16).ilog(&base), 6);
sourceimpl UBig
impl UBig
sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<UBig, ParseError>
pub fn from_str_radix(src: &str, radix: u32) -> Result<UBig, ParseError>
sourcepub fn from_str_with_radix_prefix(src: &str) -> Result<(UBig, u32), ParseError>
pub fn from_str_with_radix_prefix(src: &str) -> Result<(UBig, u32), ParseError>
Convert a string with an optional radix prefix to UBig, returns the parsed integer and radix.
src
may contain an optional +
after the radix prefix.
Allowed prefixes: 0b
for binary, 0o
for octal, 0x
for hexadecimal.
Examples
assert_eq!(UBig::from_str_with_radix_prefix("+0o17")?, (UBig::from(0o17u8), 8));
assert_eq!(UBig::from_str_with_radix_prefix("0x1f")?.0, 0x1f);
sourceimpl UBig
impl UBig
sourcepub const fn from_dword(dword: DoubleWord) -> Self
pub const fn from_dword(dword: DoubleWord) -> Self
Create a UBig from a DoubleWord.
Examples
const ZERO: UBig = UBig::from_dword(0);
assert_eq!(ZERO, UBig::ZERO);
const ONE: UBig = UBig::from_dword(1);
assert_eq!(ONE, UBig::ONE);
sourcepub fn from_words(words: &[Word]) -> Self
pub fn from_words(words: &[Word]) -> Self
Trait Implementations
sourceimpl AddAssign<&UBig> for IBig
impl AddAssign<&UBig> for IBig
sourcefn add_assign(&mut self, rhs: &UBig)
fn add_assign(&mut self, rhs: &UBig)
Performs the +=
operation. Read more
sourceimpl AddAssign<&UBig> for UBig
impl AddAssign<&UBig> for UBig
sourcefn add_assign(&mut self, rhs: &UBig)
fn add_assign(&mut self, rhs: &UBig)
Performs the +=
operation. Read more
sourceimpl AddAssign<&u128> for UBig
impl AddAssign<&u128> for UBig
sourcefn add_assign(&mut self, rhs: &u128)
fn add_assign(&mut self, rhs: &u128)
Performs the +=
operation. Read more
sourceimpl AddAssign<&u16> for UBig
impl AddAssign<&u16> for UBig
sourcefn add_assign(&mut self, rhs: &u16)
fn add_assign(&mut self, rhs: &u16)
Performs the +=
operation. Read more
sourceimpl AddAssign<&u32> for UBig
impl AddAssign<&u32> for UBig
sourcefn add_assign(&mut self, rhs: &u32)
fn add_assign(&mut self, rhs: &u32)
Performs the +=
operation. Read more
sourceimpl AddAssign<&u64> for UBig
impl AddAssign<&u64> for UBig
sourcefn add_assign(&mut self, rhs: &u64)
fn add_assign(&mut self, rhs: &u64)
Performs the +=
operation. Read more
sourceimpl AddAssign<&u8> for UBig
impl AddAssign<&u8> for UBig
sourcefn add_assign(&mut self, rhs: &u8)
fn add_assign(&mut self, rhs: &u8)
Performs the +=
operation. Read more
sourceimpl AddAssign<&usize> for UBig
impl AddAssign<&usize> for UBig
sourcefn add_assign(&mut self, rhs: &usize)
fn add_assign(&mut self, rhs: &usize)
Performs the +=
operation. Read more
sourceimpl AddAssign<UBig> for IBig
impl AddAssign<UBig> for IBig
sourcefn add_assign(&mut self, rhs: UBig)
fn add_assign(&mut self, rhs: UBig)
Performs the +=
operation. Read more
sourceimpl AddAssign<UBig> for UBig
impl AddAssign<UBig> for UBig
sourcefn add_assign(&mut self, rhs: UBig)
fn add_assign(&mut self, rhs: UBig)
Performs the +=
operation. Read more
sourceimpl AddAssign<u128> for UBig
impl AddAssign<u128> for UBig
sourcefn add_assign(&mut self, rhs: u128)
fn add_assign(&mut self, rhs: u128)
Performs the +=
operation. Read more
sourceimpl AddAssign<u16> for UBig
impl AddAssign<u16> for UBig
sourcefn add_assign(&mut self, rhs: u16)
fn add_assign(&mut self, rhs: u16)
Performs the +=
operation. Read more
sourceimpl AddAssign<u32> for UBig
impl AddAssign<u32> for UBig
sourcefn add_assign(&mut self, rhs: u32)
fn add_assign(&mut self, rhs: u32)
Performs the +=
operation. Read more
sourceimpl AddAssign<u64> for UBig
impl AddAssign<u64> for UBig
sourcefn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the +=
operation. Read more
sourceimpl AddAssign<u8> for UBig
impl AddAssign<u8> for UBig
sourcefn add_assign(&mut self, rhs: u8)
fn add_assign(&mut self, rhs: u8)
Performs the +=
operation. Read more
sourceimpl AddAssign<usize> for UBig
impl AddAssign<usize> for UBig
sourcefn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the +=
operation. Read more
sourceimpl BitAndAssign<&UBig> for UBig
impl BitAndAssign<&UBig> for UBig
sourcefn bitand_assign(&mut self, rhs: &UBig)
fn bitand_assign(&mut self, rhs: &UBig)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<&u128> for UBig
impl BitAndAssign<&u128> for UBig
sourcefn bitand_assign(&mut self, rhs: &u128)
fn bitand_assign(&mut self, rhs: &u128)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<&u16> for UBig
impl BitAndAssign<&u16> for UBig
sourcefn bitand_assign(&mut self, rhs: &u16)
fn bitand_assign(&mut self, rhs: &u16)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<&u32> for UBig
impl BitAndAssign<&u32> for UBig
sourcefn bitand_assign(&mut self, rhs: &u32)
fn bitand_assign(&mut self, rhs: &u32)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<&u64> for UBig
impl BitAndAssign<&u64> for UBig
sourcefn bitand_assign(&mut self, rhs: &u64)
fn bitand_assign(&mut self, rhs: &u64)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<&u8> for UBig
impl BitAndAssign<&u8> for UBig
sourcefn bitand_assign(&mut self, rhs: &u8)
fn bitand_assign(&mut self, rhs: &u8)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<&usize> for UBig
impl BitAndAssign<&usize> for UBig
sourcefn bitand_assign(&mut self, rhs: &usize)
fn bitand_assign(&mut self, rhs: &usize)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<UBig> for UBig
impl BitAndAssign<UBig> for UBig
sourcefn bitand_assign(&mut self, rhs: UBig)
fn bitand_assign(&mut self, rhs: UBig)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<u128> for UBig
impl BitAndAssign<u128> for UBig
sourcefn bitand_assign(&mut self, rhs: u128)
fn bitand_assign(&mut self, rhs: u128)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<u16> for UBig
impl BitAndAssign<u16> for UBig
sourcefn bitand_assign(&mut self, rhs: u16)
fn bitand_assign(&mut self, rhs: u16)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<u32> for UBig
impl BitAndAssign<u32> for UBig
sourcefn bitand_assign(&mut self, rhs: u32)
fn bitand_assign(&mut self, rhs: u32)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<u64> for UBig
impl BitAndAssign<u64> for UBig
sourcefn bitand_assign(&mut self, rhs: u64)
fn bitand_assign(&mut self, rhs: u64)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<u8> for UBig
impl BitAndAssign<u8> for UBig
sourcefn bitand_assign(&mut self, rhs: u8)
fn bitand_assign(&mut self, rhs: u8)
Performs the &=
operation. Read more
sourceimpl BitAndAssign<usize> for UBig
impl BitAndAssign<usize> for UBig
sourcefn bitand_assign(&mut self, rhs: usize)
fn bitand_assign(&mut self, rhs: usize)
Performs the &=
operation. Read more
sourceimpl BitOrAssign<&UBig> for UBig
impl BitOrAssign<&UBig> for UBig
sourcefn bitor_assign(&mut self, rhs: &UBig)
fn bitor_assign(&mut self, rhs: &UBig)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<&u128> for UBig
impl BitOrAssign<&u128> for UBig
sourcefn bitor_assign(&mut self, rhs: &u128)
fn bitor_assign(&mut self, rhs: &u128)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<&u16> for UBig
impl BitOrAssign<&u16> for UBig
sourcefn bitor_assign(&mut self, rhs: &u16)
fn bitor_assign(&mut self, rhs: &u16)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<&u32> for UBig
impl BitOrAssign<&u32> for UBig
sourcefn bitor_assign(&mut self, rhs: &u32)
fn bitor_assign(&mut self, rhs: &u32)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<&u64> for UBig
impl BitOrAssign<&u64> for UBig
sourcefn bitor_assign(&mut self, rhs: &u64)
fn bitor_assign(&mut self, rhs: &u64)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<&u8> for UBig
impl BitOrAssign<&u8> for UBig
sourcefn bitor_assign(&mut self, rhs: &u8)
fn bitor_assign(&mut self, rhs: &u8)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<&usize> for UBig
impl BitOrAssign<&usize> for UBig
sourcefn bitor_assign(&mut self, rhs: &usize)
fn bitor_assign(&mut self, rhs: &usize)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<UBig> for UBig
impl BitOrAssign<UBig> for UBig
sourcefn bitor_assign(&mut self, rhs: UBig)
fn bitor_assign(&mut self, rhs: UBig)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<u128> for UBig
impl BitOrAssign<u128> for UBig
sourcefn bitor_assign(&mut self, rhs: u128)
fn bitor_assign(&mut self, rhs: u128)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<u16> for UBig
impl BitOrAssign<u16> for UBig
sourcefn bitor_assign(&mut self, rhs: u16)
fn bitor_assign(&mut self, rhs: u16)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<u32> for UBig
impl BitOrAssign<u32> for UBig
sourcefn bitor_assign(&mut self, rhs: u32)
fn bitor_assign(&mut self, rhs: u32)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<u64> for UBig
impl BitOrAssign<u64> for UBig
sourcefn bitor_assign(&mut self, rhs: u64)
fn bitor_assign(&mut self, rhs: u64)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<u8> for UBig
impl BitOrAssign<u8> for UBig
sourcefn bitor_assign(&mut self, rhs: u8)
fn bitor_assign(&mut self, rhs: u8)
Performs the |=
operation. Read more
sourceimpl BitOrAssign<usize> for UBig
impl BitOrAssign<usize> for UBig
sourcefn bitor_assign(&mut self, rhs: usize)
fn bitor_assign(&mut self, rhs: usize)
Performs the |=
operation. Read more
sourceimpl BitXorAssign<&UBig> for UBig
impl BitXorAssign<&UBig> for UBig
sourcefn bitxor_assign(&mut self, rhs: &UBig)
fn bitxor_assign(&mut self, rhs: &UBig)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<&u128> for UBig
impl BitXorAssign<&u128> for UBig
sourcefn bitxor_assign(&mut self, rhs: &u128)
fn bitxor_assign(&mut self, rhs: &u128)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<&u16> for UBig
impl BitXorAssign<&u16> for UBig
sourcefn bitxor_assign(&mut self, rhs: &u16)
fn bitxor_assign(&mut self, rhs: &u16)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<&u32> for UBig
impl BitXorAssign<&u32> for UBig
sourcefn bitxor_assign(&mut self, rhs: &u32)
fn bitxor_assign(&mut self, rhs: &u32)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<&u64> for UBig
impl BitXorAssign<&u64> for UBig
sourcefn bitxor_assign(&mut self, rhs: &u64)
fn bitxor_assign(&mut self, rhs: &u64)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<&u8> for UBig
impl BitXorAssign<&u8> for UBig
sourcefn bitxor_assign(&mut self, rhs: &u8)
fn bitxor_assign(&mut self, rhs: &u8)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<&usize> for UBig
impl BitXorAssign<&usize> for UBig
sourcefn bitxor_assign(&mut self, rhs: &usize)
fn bitxor_assign(&mut self, rhs: &usize)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<UBig> for UBig
impl BitXorAssign<UBig> for UBig
sourcefn bitxor_assign(&mut self, rhs: UBig)
fn bitxor_assign(&mut self, rhs: UBig)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<u128> for UBig
impl BitXorAssign<u128> for UBig
sourcefn bitxor_assign(&mut self, rhs: u128)
fn bitxor_assign(&mut self, rhs: u128)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<u16> for UBig
impl BitXorAssign<u16> for UBig
sourcefn bitxor_assign(&mut self, rhs: u16)
fn bitxor_assign(&mut self, rhs: u16)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<u32> for UBig
impl BitXorAssign<u32> for UBig
sourcefn bitxor_assign(&mut self, rhs: u32)
fn bitxor_assign(&mut self, rhs: u32)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<u64> for UBig
impl BitXorAssign<u64> for UBig
sourcefn bitxor_assign(&mut self, rhs: u64)
fn bitxor_assign(&mut self, rhs: u64)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<u8> for UBig
impl BitXorAssign<u8> for UBig
sourcefn bitxor_assign(&mut self, rhs: u8)
fn bitxor_assign(&mut self, rhs: u8)
Performs the ^=
operation. Read more
sourceimpl BitXorAssign<usize> for UBig
impl BitXorAssign<usize> for UBig
sourcefn bitxor_assign(&mut self, rhs: usize)
fn bitxor_assign(&mut self, rhs: usize)
Performs the ^=
operation. Read more
sourceimpl<'de> Deserialize<'de> for UBig
impl<'de> Deserialize<'de> for UBig
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'l, 'r> Div<&'r ConstDivisor> for &'l UBig
impl<'l, 'r> Div<&'r ConstDivisor> for &'l UBig
sourceimpl<'r> Div<&'r ConstDivisor> for UBig
impl<'r> Div<&'r ConstDivisor> for UBig
sourceimpl<'r> DivAssign<&'r ConstDivisor> for UBig
impl<'r> DivAssign<&'r ConstDivisor> for UBig
sourcefn div_assign(&mut self, rhs: &'r ConstDivisor)
fn div_assign(&mut self, rhs: &'r ConstDivisor)
Performs the /=
operation. Read more
sourceimpl DivAssign<&UBig> for IBig
impl DivAssign<&UBig> for IBig
sourcefn div_assign(&mut self, rhs: &UBig)
fn div_assign(&mut self, rhs: &UBig)
Performs the /=
operation. Read more
sourceimpl DivAssign<&UBig> for UBig
impl DivAssign<&UBig> for UBig
sourcefn div_assign(&mut self, rhs: &UBig)
fn div_assign(&mut self, rhs: &UBig)
Performs the /=
operation. Read more
sourceimpl DivAssign<&u128> for UBig
impl DivAssign<&u128> for UBig
sourcefn div_assign(&mut self, rhs: &u128)
fn div_assign(&mut self, rhs: &u128)
Performs the /=
operation. Read more
sourceimpl DivAssign<&u16> for UBig
impl DivAssign<&u16> for UBig
sourcefn div_assign(&mut self, rhs: &u16)
fn div_assign(&mut self, rhs: &u16)
Performs the /=
operation. Read more
sourceimpl DivAssign<&u32> for UBig
impl DivAssign<&u32> for UBig
sourcefn div_assign(&mut self, rhs: &u32)
fn div_assign(&mut self, rhs: &u32)
Performs the /=
operation. Read more
sourceimpl DivAssign<&u64> for UBig
impl DivAssign<&u64> for UBig
sourcefn div_assign(&mut self, rhs: &u64)
fn div_assign(&mut self, rhs: &u64)
Performs the /=
operation. Read more
sourceimpl DivAssign<&u8> for UBig
impl DivAssign<&u8> for UBig
sourcefn div_assign(&mut self, rhs: &u8)
fn div_assign(&mut self, rhs: &u8)
Performs the /=
operation. Read more
sourceimpl DivAssign<&usize> for UBig
impl DivAssign<&usize> for UBig
sourcefn div_assign(&mut self, rhs: &usize)
fn div_assign(&mut self, rhs: &usize)
Performs the /=
operation. Read more
sourceimpl DivAssign<UBig> for IBig
impl DivAssign<UBig> for IBig
sourcefn div_assign(&mut self, rhs: UBig)
fn div_assign(&mut self, rhs: UBig)
Performs the /=
operation. Read more
sourceimpl DivAssign<UBig> for UBig
impl DivAssign<UBig> for UBig
sourcefn div_assign(&mut self, rhs: UBig)
fn div_assign(&mut self, rhs: UBig)
Performs the /=
operation. Read more
sourceimpl DivAssign<u128> for UBig
impl DivAssign<u128> for UBig
sourcefn div_assign(&mut self, rhs: u128)
fn div_assign(&mut self, rhs: u128)
Performs the /=
operation. Read more
sourceimpl DivAssign<u16> for UBig
impl DivAssign<u16> for UBig
sourcefn div_assign(&mut self, rhs: u16)
fn div_assign(&mut self, rhs: u16)
Performs the /=
operation. Read more
sourceimpl DivAssign<u32> for UBig
impl DivAssign<u32> for UBig
sourcefn div_assign(&mut self, rhs: u32)
fn div_assign(&mut self, rhs: u32)
Performs the /=
operation. Read more
sourceimpl DivAssign<u64> for UBig
impl DivAssign<u64> for UBig
sourcefn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
Performs the /=
operation. Read more
sourceimpl DivAssign<u8> for UBig
impl DivAssign<u8> for UBig
sourcefn div_assign(&mut self, rhs: u8)
fn div_assign(&mut self, rhs: u8)
Performs the /=
operation. Read more
sourceimpl DivAssign<usize> for UBig
impl DivAssign<usize> for UBig
sourcefn div_assign(&mut self, rhs: usize)
fn div_assign(&mut self, rhs: usize)
Performs the /=
operation. Read more
sourceimpl<'l, 'r> DivRem<&'r ConstDivisor> for &'l UBig
impl<'l, 'r> DivRem<&'r ConstDivisor> for &'l UBig
sourceimpl<'r> DivRem<&'r ConstDivisor> for UBig
impl<'r> DivRem<&'r ConstDivisor> for UBig
sourceimpl<'r> DivRemAssign<&'r ConstDivisor> for UBig
impl<'r> DivRemAssign<&'r ConstDivisor> for UBig
type OutputRem = UBig
fn div_rem_assign(&mut self, rhs: &ConstDivisor) -> UBig
sourceimpl DivRemAssign<&UBig> for UBig
impl DivRemAssign<&UBig> for UBig
sourceimpl DivRemAssign<&u128> for UBig
impl DivRemAssign<&u128> for UBig
sourceimpl DivRemAssign<&u16> for UBig
impl DivRemAssign<&u16> for UBig
sourceimpl DivRemAssign<&u32> for UBig
impl DivRemAssign<&u32> for UBig
sourceimpl DivRemAssign<&u64> for UBig
impl DivRemAssign<&u64> for UBig
sourceimpl DivRemAssign<&u8> for UBig
impl DivRemAssign<&u8> for UBig
sourceimpl DivRemAssign<&usize> for UBig
impl DivRemAssign<&usize> for UBig
sourceimpl DivRemAssign<UBig> for UBig
impl DivRemAssign<UBig> for UBig
sourceimpl DivRemAssign<u128> for UBig
impl DivRemAssign<u128> for UBig
sourceimpl DivRemAssign<u16> for UBig
impl DivRemAssign<u16> for UBig
sourceimpl DivRemAssign<u32> for UBig
impl DivRemAssign<u32> for UBig
sourceimpl DivRemAssign<u64> for UBig
impl DivRemAssign<u64> for UBig
sourceimpl DivRemAssign<u8> for UBig
impl DivRemAssign<u8> for UBig
sourceimpl DivRemAssign<usize> for UBig
impl DivRemAssign<usize> for UBig
sourceimpl<'l, 'r> DivRemEuclid<&'r UBig> for &'l UBig
impl<'l, 'r> DivRemEuclid<&'r UBig> for &'l UBig
sourceimpl<'r> DivRemEuclid<&'r UBig> for UBig
impl<'r> DivRemEuclid<&'r UBig> for UBig
sourceimpl<'l> DivRemEuclid<UBig> for &'l UBig
impl<'l> DivRemEuclid<UBig> for &'l UBig
sourceimpl DivRemEuclid<UBig> for UBig
impl DivRemEuclid<UBig> for UBig
sourceimpl EstimatedLog2 for UBig
impl EstimatedLog2 for UBig
sourcefn log2_bounds(&self) -> (f32, f32)
fn log2_bounds(&self) -> (f32, f32)
Estimate the bounds of the binary logarithm. Read more
sourcefn log2_est(&self) -> f32
fn log2_est(&self) -> f32
Estimate the value of the binary logarithm. It’s calculated as the average of log2_bounds by default. Read more
sourceimpl<'l, 'r> ExtendedGcd<&'r UBig> for &'l UBig
impl<'l, 'r> ExtendedGcd<&'r UBig> for &'l UBig
sourceimpl<'r> ExtendedGcd<&'r UBig> for UBig
impl<'r> ExtendedGcd<&'r UBig> for UBig
sourceimpl<'l> ExtendedGcd<UBig> for &'l UBig
impl<'l> ExtendedGcd<UBig> for &'l UBig
sourceimpl ExtendedGcd<UBig> for UBig
impl ExtendedGcd<UBig> for UBig
sourceimpl FromStr for UBig
impl FromStr for UBig
type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
sourceimpl IntoModulo for &UBig
impl IntoModulo for &UBig
fn into_modulo(self, ring: &ModuloRing) -> Modulo<'_>
sourceimpl IntoModulo for UBig
impl IntoModulo for UBig
fn into_modulo(self, ring: &ModuloRing) -> Modulo<'_>
sourceimpl MulAssign<&UBig> for IBig
impl MulAssign<&UBig> for IBig
sourcefn mul_assign(&mut self, rhs: &UBig)
fn mul_assign(&mut self, rhs: &UBig)
Performs the *=
operation. Read more
sourceimpl MulAssign<&UBig> for UBig
impl MulAssign<&UBig> for UBig
sourcefn mul_assign(&mut self, rhs: &UBig)
fn mul_assign(&mut self, rhs: &UBig)
Performs the *=
operation. Read more
sourceimpl MulAssign<&u128> for UBig
impl MulAssign<&u128> for UBig
sourcefn mul_assign(&mut self, rhs: &u128)
fn mul_assign(&mut self, rhs: &u128)
Performs the *=
operation. Read more
sourceimpl MulAssign<&u16> for UBig
impl MulAssign<&u16> for UBig
sourcefn mul_assign(&mut self, rhs: &u16)
fn mul_assign(&mut self, rhs: &u16)
Performs the *=
operation. Read more
sourceimpl MulAssign<&u32> for UBig
impl MulAssign<&u32> for UBig
sourcefn mul_assign(&mut self, rhs: &u32)
fn mul_assign(&mut self, rhs: &u32)
Performs the *=
operation. Read more
sourceimpl MulAssign<&u64> for UBig
impl MulAssign<&u64> for UBig
sourcefn mul_assign(&mut self, rhs: &u64)
fn mul_assign(&mut self, rhs: &u64)
Performs the *=
operation. Read more
sourceimpl MulAssign<&u8> for UBig
impl MulAssign<&u8> for UBig
sourcefn mul_assign(&mut self, rhs: &u8)
fn mul_assign(&mut self, rhs: &u8)
Performs the *=
operation. Read more
sourceimpl MulAssign<&usize> for UBig
impl MulAssign<&usize> for UBig
sourcefn mul_assign(&mut self, rhs: &usize)
fn mul_assign(&mut self, rhs: &usize)
Performs the *=
operation. Read more
sourceimpl MulAssign<UBig> for IBig
impl MulAssign<UBig> for IBig
sourcefn mul_assign(&mut self, rhs: UBig)
fn mul_assign(&mut self, rhs: UBig)
Performs the *=
operation. Read more
sourceimpl MulAssign<UBig> for UBig
impl MulAssign<UBig> for UBig
sourcefn mul_assign(&mut self, rhs: UBig)
fn mul_assign(&mut self, rhs: UBig)
Performs the *=
operation. Read more
sourceimpl MulAssign<u128> for UBig
impl MulAssign<u128> for UBig
sourcefn mul_assign(&mut self, rhs: u128)
fn mul_assign(&mut self, rhs: u128)
Performs the *=
operation. Read more
sourceimpl MulAssign<u16> for UBig
impl MulAssign<u16> for UBig
sourcefn mul_assign(&mut self, rhs: u16)
fn mul_assign(&mut self, rhs: u16)
Performs the *=
operation. Read more
sourceimpl MulAssign<u32> for UBig
impl MulAssign<u32> for UBig
sourcefn mul_assign(&mut self, rhs: u32)
fn mul_assign(&mut self, rhs: u32)
Performs the *=
operation. Read more
sourceimpl MulAssign<u64> for UBig
impl MulAssign<u64> for UBig
sourcefn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
Performs the *=
operation. Read more
sourceimpl MulAssign<u8> for UBig
impl MulAssign<u8> for UBig
sourcefn mul_assign(&mut self, rhs: u8)
fn mul_assign(&mut self, rhs: u8)
Performs the *=
operation. Read more
sourceimpl MulAssign<usize> for UBig
impl MulAssign<usize> for UBig
sourcefn mul_assign(&mut self, rhs: usize)
fn mul_assign(&mut self, rhs: usize)
Performs the *=
operation. Read more
sourceimpl Num for UBig
impl Num for UBig
type FromStrRadixErr = ParseError
sourcefn from_str_radix(s: &str, radix: u32) -> Result<Self, ParseError>
fn from_str_radix(s: &str, radix: u32) -> Result<Self, ParseError>
Convert from a string and radix (typically 2..=36
). Read more
sourceimpl Ord for UBig
impl Ord for UBig
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<IBig> for UBig
impl PartialEq<IBig> for UBig
sourceimpl PartialEq<UBig> for IBig
impl PartialEq<UBig> for IBig
sourceimpl PartialEq<UBig> for UBig
impl PartialEq<UBig> for UBig
sourceimpl PartialEq<UBig> for i128
impl PartialEq<UBig> for i128
sourceimpl PartialEq<UBig> for i16
impl PartialEq<UBig> for i16
sourceimpl PartialEq<UBig> for i32
impl PartialEq<UBig> for i32
sourceimpl PartialEq<UBig> for i64
impl PartialEq<UBig> for i64
sourceimpl PartialEq<UBig> for i8
impl PartialEq<UBig> for i8
sourceimpl PartialEq<UBig> for isize
impl PartialEq<UBig> for isize
sourceimpl PartialEq<UBig> for u128
impl PartialEq<UBig> for u128
sourceimpl PartialEq<UBig> for u16
impl PartialEq<UBig> for u16
sourceimpl PartialEq<UBig> for u32
impl PartialEq<UBig> for u32
sourceimpl PartialEq<UBig> for u64
impl PartialEq<UBig> for u64
sourceimpl PartialEq<UBig> for u8
impl PartialEq<UBig> for u8
sourceimpl PartialEq<UBig> for usize
impl PartialEq<UBig> for usize
sourceimpl PartialEq<i128> for UBig
impl PartialEq<i128> for UBig
sourceimpl PartialEq<i16> for UBig
impl PartialEq<i16> for UBig
sourceimpl PartialEq<i32> for UBig
impl PartialEq<i32> for UBig
sourceimpl PartialEq<i64> for UBig
impl PartialEq<i64> for UBig
sourceimpl PartialEq<i8> for UBig
impl PartialEq<i8> for UBig
sourceimpl PartialEq<isize> for UBig
impl PartialEq<isize> for UBig
sourceimpl PartialEq<u128> for UBig
impl PartialEq<u128> for UBig
sourceimpl PartialEq<u16> for UBig
impl PartialEq<u16> for UBig
sourceimpl PartialEq<u32> for UBig
impl PartialEq<u32> for UBig
sourceimpl PartialEq<u64> for UBig
impl PartialEq<u64> for UBig
sourceimpl PartialEq<u8> for UBig
impl PartialEq<u8> for UBig
sourceimpl PartialEq<usize> for UBig
impl PartialEq<usize> for UBig
sourceimpl PartialOrd<IBig> for UBig
impl PartialOrd<IBig> for UBig
sourcefn partial_cmp(&self, other: &IBig) -> Option<Ordering>
fn partial_cmp(&self, other: &IBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for IBig
impl PartialOrd<UBig> for IBig
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for UBig
impl PartialOrd<UBig> for UBig
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for i128
impl PartialOrd<UBig> for i128
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for i16
impl PartialOrd<UBig> for i16
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for i32
impl PartialOrd<UBig> for i32
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for i64
impl PartialOrd<UBig> for i64
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for i8
impl PartialOrd<UBig> for i8
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for isize
impl PartialOrd<UBig> for isize
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for u128
impl PartialOrd<UBig> for u128
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for u16
impl PartialOrd<UBig> for u16
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for u32
impl PartialOrd<UBig> for u32
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for u64
impl PartialOrd<UBig> for u64
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for u8
impl PartialOrd<UBig> for u8
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<UBig> for usize
impl PartialOrd<UBig> for usize
sourcefn partial_cmp(&self, other: &UBig) -> Option<Ordering>
fn partial_cmp(&self, other: &UBig) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<i128> for UBig
impl PartialOrd<i128> for UBig
sourcefn partial_cmp(&self, other: &i128) -> Option<Ordering>
fn partial_cmp(&self, other: &i128) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<i16> for UBig
impl PartialOrd<i16> for UBig
sourcefn partial_cmp(&self, other: &i16) -> Option<Ordering>
fn partial_cmp(&self, other: &i16) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<i32> for UBig
impl PartialOrd<i32> for UBig
sourcefn partial_cmp(&self, other: &i32) -> Option<Ordering>
fn partial_cmp(&self, other: &i32) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<i64> for UBig
impl PartialOrd<i64> for UBig
sourcefn partial_cmp(&self, other: &i64) -> Option<Ordering>
fn partial_cmp(&self, other: &i64) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<i8> for UBig
impl PartialOrd<i8> for UBig
sourcefn partial_cmp(&self, other: &i8) -> Option<Ordering>
fn partial_cmp(&self, other: &i8) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<isize> for UBig
impl PartialOrd<isize> for UBig
sourcefn partial_cmp(&self, other: &isize) -> Option<Ordering>
fn partial_cmp(&self, other: &isize) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<u128> for UBig
impl PartialOrd<u128> for UBig
sourcefn partial_cmp(&self, other: &u128) -> Option<Ordering>
fn partial_cmp(&self, other: &u128) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<u16> for UBig
impl PartialOrd<u16> for UBig
sourcefn partial_cmp(&self, other: &u16) -> Option<Ordering>
fn partial_cmp(&self, other: &u16) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<u32> for UBig
impl PartialOrd<u32> for UBig
sourcefn partial_cmp(&self, other: &u32) -> Option<Ordering>
fn partial_cmp(&self, other: &u32) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<u64> for UBig
impl PartialOrd<u64> for UBig
sourcefn partial_cmp(&self, other: &u64) -> Option<Ordering>
fn partial_cmp(&self, other: &u64) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<u8> for UBig
impl PartialOrd<u8> for UBig
sourcefn partial_cmp(&self, other: &u8) -> Option<Ordering>
fn partial_cmp(&self, other: &u8) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<usize> for UBig
impl PartialOrd<usize> for UBig
sourcefn partial_cmp(&self, other: &usize) -> Option<Ordering>
fn partial_cmp(&self, other: &usize) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PowerOfTwo for UBig
impl PowerOfTwo for UBig
fn is_power_of_two(&self) -> bool
fn next_power_of_two(self) -> UBig
sourceimpl<'l, 'r> Rem<&'r ConstDivisor> for &'l UBig
impl<'l, 'r> Rem<&'r ConstDivisor> for &'l UBig
sourceimpl<'r> Rem<&'r ConstDivisor> for UBig
impl<'r> Rem<&'r ConstDivisor> for UBig
sourceimpl<'r> RemAssign<&'r ConstDivisor> for UBig
impl<'r> RemAssign<&'r ConstDivisor> for UBig
sourcefn rem_assign(&mut self, rhs: &'r ConstDivisor)
fn rem_assign(&mut self, rhs: &'r ConstDivisor)
Performs the %=
operation. Read more
sourceimpl RemAssign<&IBig> for UBig
impl RemAssign<&IBig> for UBig
sourcefn rem_assign(&mut self, rhs: &IBig)
fn rem_assign(&mut self, rhs: &IBig)
Performs the %=
operation. Read more
sourceimpl RemAssign<&UBig> for IBig
impl RemAssign<&UBig> for IBig
sourcefn rem_assign(&mut self, rhs: &UBig)
fn rem_assign(&mut self, rhs: &UBig)
Performs the %=
operation. Read more
sourceimpl RemAssign<&UBig> for UBig
impl RemAssign<&UBig> for UBig
sourcefn rem_assign(&mut self, rhs: &UBig)
fn rem_assign(&mut self, rhs: &UBig)
Performs the %=
operation. Read more
sourceimpl RemAssign<IBig> for UBig
impl RemAssign<IBig> for UBig
sourcefn rem_assign(&mut self, rhs: IBig)
fn rem_assign(&mut self, rhs: IBig)
Performs the %=
operation. Read more
sourceimpl RemAssign<UBig> for IBig
impl RemAssign<UBig> for IBig
sourcefn rem_assign(&mut self, rhs: UBig)
fn rem_assign(&mut self, rhs: UBig)
Performs the %=
operation. Read more
sourceimpl RemAssign<UBig> for UBig
impl RemAssign<UBig> for UBig
sourcefn rem_assign(&mut self, rhs: UBig)
fn rem_assign(&mut self, rhs: UBig)
Performs the %=
operation. Read more
sourceimpl SampleUniform for UBig
impl SampleUniform for UBig
type Sampler = UniformUBig
type Sampler = UniformUBig
The UniformSampler
implementation supporting type X
.
sourceimpl ShlAssign<&usize> for UBig
impl ShlAssign<&usize> for UBig
sourcefn shl_assign(&mut self, rhs: &usize)
fn shl_assign(&mut self, rhs: &usize)
Performs the <<=
operation. Read more
sourceimpl ShlAssign<usize> for UBig
impl ShlAssign<usize> for UBig
sourcefn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
Performs the <<=
operation. Read more
sourceimpl ShrAssign<&usize> for UBig
impl ShrAssign<&usize> for UBig
sourcefn shr_assign(&mut self, rhs: &usize)
fn shr_assign(&mut self, rhs: &usize)
Performs the >>=
operation. Read more
sourceimpl ShrAssign<usize> for UBig
impl ShrAssign<usize> for UBig
sourcefn shr_assign(&mut self, rhs: usize)
fn shr_assign(&mut self, rhs: usize)
Performs the >>=
operation. Read more
sourceimpl SubAssign<&UBig> for IBig
impl SubAssign<&UBig> for IBig
sourcefn sub_assign(&mut self, rhs: &UBig)
fn sub_assign(&mut self, rhs: &UBig)
Performs the -=
operation. Read more
sourceimpl SubAssign<&UBig> for UBig
impl SubAssign<&UBig> for UBig
sourcefn sub_assign(&mut self, rhs: &UBig)
fn sub_assign(&mut self, rhs: &UBig)
Performs the -=
operation. Read more
sourceimpl SubAssign<&u128> for UBig
impl SubAssign<&u128> for UBig
sourcefn sub_assign(&mut self, rhs: &u128)
fn sub_assign(&mut self, rhs: &u128)
Performs the -=
operation. Read more
sourceimpl SubAssign<&u16> for UBig
impl SubAssign<&u16> for UBig
sourcefn sub_assign(&mut self, rhs: &u16)
fn sub_assign(&mut self, rhs: &u16)
Performs the -=
operation. Read more
sourceimpl SubAssign<&u32> for UBig
impl SubAssign<&u32> for UBig
sourcefn sub_assign(&mut self, rhs: &u32)
fn sub_assign(&mut self, rhs: &u32)
Performs the -=
operation. Read more
sourceimpl SubAssign<&u64> for UBig
impl SubAssign<&u64> for UBig
sourcefn sub_assign(&mut self, rhs: &u64)
fn sub_assign(&mut self, rhs: &u64)
Performs the -=
operation. Read more
sourceimpl SubAssign<&u8> for UBig
impl SubAssign<&u8> for UBig
sourcefn sub_assign(&mut self, rhs: &u8)
fn sub_assign(&mut self, rhs: &u8)
Performs the -=
operation. Read more
sourceimpl SubAssign<&usize> for UBig
impl SubAssign<&usize> for UBig
sourcefn sub_assign(&mut self, rhs: &usize)
fn sub_assign(&mut self, rhs: &usize)
Performs the -=
operation. Read more
sourceimpl SubAssign<UBig> for IBig
impl SubAssign<UBig> for IBig
sourcefn sub_assign(&mut self, rhs: UBig)
fn sub_assign(&mut self, rhs: UBig)
Performs the -=
operation. Read more
sourceimpl SubAssign<UBig> for UBig
impl SubAssign<UBig> for UBig
sourcefn sub_assign(&mut self, rhs: UBig)
fn sub_assign(&mut self, rhs: UBig)
Performs the -=
operation. Read more
sourceimpl SubAssign<u128> for UBig
impl SubAssign<u128> for UBig
sourcefn sub_assign(&mut self, rhs: u128)
fn sub_assign(&mut self, rhs: u128)
Performs the -=
operation. Read more
sourceimpl SubAssign<u16> for UBig
impl SubAssign<u16> for UBig
sourcefn sub_assign(&mut self, rhs: u16)
fn sub_assign(&mut self, rhs: u16)
Performs the -=
operation. Read more
sourceimpl SubAssign<u32> for UBig
impl SubAssign<u32> for UBig
sourcefn sub_assign(&mut self, rhs: u32)
fn sub_assign(&mut self, rhs: u32)
Performs the -=
operation. Read more
sourceimpl SubAssign<u64> for UBig
impl SubAssign<u64> for UBig
sourcefn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
Performs the -=
operation. Read more
sourceimpl SubAssign<u8> for UBig
impl SubAssign<u8> for UBig
sourcefn sub_assign(&mut self, rhs: u8)
fn sub_assign(&mut self, rhs: u8)
Performs the -=
operation. Read more
sourceimpl SubAssign<usize> for UBig
impl SubAssign<usize> for UBig
sourcefn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
Performs the -=
operation. Read more
sourceimpl TryFrom<&IBig> for UBig
impl TryFrom<&IBig> for UBig
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for i128
impl TryFrom<&UBig> for i128
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for i16
impl TryFrom<&UBig> for i16
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for i32
impl TryFrom<&UBig> for i32
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for i64
impl TryFrom<&UBig> for i64
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for i8
impl TryFrom<&UBig> for i8
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for isize
impl TryFrom<&UBig> for isize
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for u128
impl TryFrom<&UBig> for u128
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for u16
impl TryFrom<&UBig> for u16
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for u32
impl TryFrom<&UBig> for u32
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for u64
impl TryFrom<&UBig> for u64
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for u8
impl TryFrom<&UBig> for u8
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<&UBig> for usize
impl TryFrom<&UBig> for usize
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<IBig> for UBig
impl TryFrom<IBig> for UBig
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for i128
impl TryFrom<UBig> for i128
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for i16
impl TryFrom<UBig> for i16
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for i32
impl TryFrom<UBig> for i32
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for i64
impl TryFrom<UBig> for i64
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for i8
impl TryFrom<UBig> for i8
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for isize
impl TryFrom<UBig> for isize
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for u128
impl TryFrom<UBig> for u128
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for u16
impl TryFrom<UBig> for u16
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for u32
impl TryFrom<UBig> for u32
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for u64
impl TryFrom<UBig> for u64
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for u8
impl TryFrom<UBig> for u8
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<UBig> for usize
impl TryFrom<UBig> for usize
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<i128> for UBig
impl TryFrom<i128> for UBig
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<i16> for UBig
impl TryFrom<i16> for UBig
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<i32> for UBig
impl TryFrom<i32> for UBig
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<i64> for UBig
impl TryFrom<i64> for UBig
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<i8> for UBig
impl TryFrom<i8> for UBig
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
sourceimpl TryFrom<isize> for UBig
impl TryFrom<isize> for UBig
type Error = OutOfBoundsError
type Error = OutOfBoundsError
The type returned in the event of a conversion error.
impl Eq for UBig
impl StructuralEq for UBig
impl StructuralPartialEq for UBig
impl Unsigned for UBig
Auto Trait Implementations
impl RefUnwindSafe for UBig
impl Send for UBig
impl Sync for UBig
impl Unpin for UBig
impl UnwindSafe for UBig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Borrowed> SampleBorrow<Borrowed> for Borrowedwhere
Borrowed: SampleUniform,
impl<Borrowed> SampleBorrow<Borrowed> for Borrowedwhere
Borrowed: SampleUniform,
sourcefn borrow(&self) -> &Borrowed
fn borrow(&self) -> &Borrowed
Immutably borrows from an owned value. See Borrow::borrow
Read more