pub(crate) struct BIG_1 {
__private_field: (),
}Fields§
§__private_field: ()Methods from Deref<Target = BigUint>§
pub fn get_limb(&self, i: usize) -> u64
Sourcepub fn to_bytes_be(&self) -> Vec<u8> ⓘ
pub fn to_bytes_be(&self) -> Vec<u8> ⓘ
Returns the byte representation of the BigUint in big-endian byte order.
§Examples
use num_bigint_dig::BigUint;
let i = BigUint::parse_bytes(b"1125", 10).unwrap();
assert_eq!(i.to_bytes_be(), vec![4, 101]);Sourcepub fn to_bytes_le(&self) -> Vec<u8> ⓘ
pub fn to_bytes_le(&self) -> Vec<u8> ⓘ
Returns the byte representation of the BigUint in little-endian byte order.
§Examples
use num_bigint_dig::BigUint;
let i = BigUint::parse_bytes(b"1125", 10).unwrap();
assert_eq!(i.to_bytes_le(), vec![101, 4]);Sourcepub fn to_str_radix(&self, radix: u32) -> String
pub fn to_str_radix(&self, radix: u32) -> String
Returns the integer formatted as a string in the given radix.
radix must be in the range 2...36.
§Examples
use num_bigint_dig::BigUint;
let i = BigUint::parse_bytes(b"ff", 16).unwrap();
assert_eq!(i.to_str_radix(16), "ff");Sourcepub fn to_radix_be(&self, radix: u32) -> Vec<u8> ⓘ
pub fn to_radix_be(&self, radix: u32) -> Vec<u8> ⓘ
Returns the integer in the requested base in big-endian digit order.
The output is not given in a human readable alphabet but as a zero
based u8 number.
radix must be in the range 2...256.
§Examples
use num_bigint_dig::BigUint;
assert_eq!(BigUint::from(0xFFFFu64).to_radix_be(159),
vec![2, 94, 27]);
// 0xFFFF = 65535 = 2*(159^2) + 94*159 + 27Sourcepub fn to_radix_le(&self, radix: u32) -> Vec<u8> ⓘ
pub fn to_radix_le(&self, radix: u32) -> Vec<u8> ⓘ
Returns the integer in the requested base in little-endian digit order.
The output is not given in a human readable alphabet but as a zero
based u8 number.
radix must be in the range 2...256.
§Examples
use num_bigint_dig::BigUint;
assert_eq!(BigUint::from(0xFFFFu64).to_radix_le(159),
vec![27, 94, 2]);
// 0xFFFF = 65535 = 27 + 94*159 + 2*(159^2)Sourcepub fn modpow(&self, exponent: &Self, modulus: &Self) -> Self
pub fn modpow(&self, exponent: &Self, modulus: &Self) -> Self
Returns (self ^ exponent) % modulus.
Panics if the modulus is zero.
Sourcepub fn sqrt(&self) -> Self
pub fn sqrt(&self) -> Self
Returns the truncated principal square root of self –
see Roots::sqrt
Sourcepub fn cbrt(&self) -> Self
pub fn cbrt(&self) -> Self
Returns the truncated principal cube root of self –
see Roots::cbrt.
Sourcepub fn nth_root(&self, n: u32) -> Self
pub fn nth_root(&self, n: u32) -> Self
Returns the truncated principal nth root of self –
see Roots::nth_root.