Struct snarkvm_utilities::biginteger::BigInteger256
source · pub struct BigInteger256(pub [u64; 4]);
Tuple Fields§
§0: [u64; 4]
Implementations§
Trait Implementations§
source§impl AsMut<[u64]> for BigInteger256
impl AsMut<[u64]> for BigInteger256
source§impl AsRef<[u64]> for BigInteger256
impl AsRef<[u64]> for BigInteger256
source§impl BigInteger for BigInteger256
impl BigInteger for BigInteger256
source§fn add_nocarry(&mut self, other: &Self) -> bool
fn add_nocarry(&mut self, other: &Self) -> bool
Add another representation to this one, returning the carry bit.
source§fn sub_noborrow(&mut self, other: &Self) -> bool
fn sub_noborrow(&mut self, other: &Self) -> bool
Subtract another representation from this one, returning the borrow bit.
source§fn mul2(&mut self)
fn mul2(&mut self)
Performs a leftwise bitshift of this number, effectively multiplying
it by 2. Overflow is ignored.
source§fn div2(&mut self)
fn div2(&mut self)
Performs a rightwise bitshift of this number, effectively dividing
it by 2.
source§fn num_bits(&self) -> u32
fn num_bits(&self) -> u32
Compute the number of bits needed to encode this number. Always a
multiple of 64.
source§fn to_biguint(&self) -> BigUint
fn to_biguint(&self) -> BigUint
Returns the BigUint representation.
source§impl Clone for BigInteger256
impl Clone for BigInteger256
source§fn clone(&self) -> BigInteger256
fn clone(&self) -> BigInteger256
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BigInteger256
impl Debug for BigInteger256
source§impl Default for BigInteger256
impl Default for BigInteger256
source§fn default() -> BigInteger256
fn default() -> BigInteger256
Returns the “default value” for a type. Read more
source§impl Display for BigInteger256
impl Display for BigInteger256
source§impl Distribution<BigInteger256> for Standard
impl Distribution<BigInteger256> for Standard
source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> BigInteger256
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> BigInteger256
Generate a random value of
T
, using rng
as the source of randomness.source§impl From<u64> for BigInteger256
impl From<u64> for BigInteger256
source§fn from(val: u64) -> BigInteger256
fn from(val: u64) -> BigInteger256
Converts to this type from the input type.
source§impl FromBits for BigInteger256
impl FromBits for BigInteger256
source§fn from_bits_le(bits: &[bool]) -> Result<Self>
fn from_bits_le(bits: &[bool]) -> Result<Self>
Returns a BigInteger
by parsing a slice of bits in little-endian format
and transforms it into a slice of little-endian u64 elements.
source§fn from_bits_be(bits: &[bool]) -> Result<Self>
fn from_bits_be(bits: &[bool]) -> Result<Self>
Returns a BigInteger
by parsing a slice of bits in big-endian format
and transforms it into a slice of little-endian u64 elements.
source§impl FromBytes for BigInteger256
impl FromBytes for BigInteger256
source§impl Hash for BigInteger256
impl Hash for BigInteger256
source§impl Ord for BigInteger256
impl Ord for BigInteger256
source§impl PartialEq<BigInteger256> for BigInteger256
impl PartialEq<BigInteger256> for BigInteger256
source§fn eq(&self, other: &BigInteger256) -> bool
fn eq(&self, other: &BigInteger256) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<BigInteger256> for BigInteger256
impl PartialOrd<BigInteger256> for BigInteger256
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 ToBits for BigInteger256
impl ToBits for BigInteger256
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order, with trailing zeros.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order, with leading zeros.