Struct bigint::uint::U256[][src]

#[repr(C)]
pub struct U256(pub [u64; 4]);

Little-endian large integer type

Methods

impl U256
[src]

Convert from a decimal string.

Conversion to u32

Conversion to u64

Conversion to u32 with overflow checking

Panics

Panics if the number is larger than 2^32.

Conversion to u64 with overflow checking

Panics

Panics if the number is larger than 2^64.

Whether this is zero.

Return the least number of bits needed to represent the number

Return if specific bit is set.

Panics

Panics if index exceeds the bit width of the number.

Returns the number of leading zeros in the binary representation of self.

Returns the number of leading zeros in the binary representation of self.

Return specific byte.

Panics

Panics if index exceeds the byte width of the number.

Write to the slice in big-endian format.

Write to the slice in little-endian format.

Create 10**n as this type.

Panics

Panics if the result overflows the type.

Zero (additive identity) of this type.

One (multiplicative identity) of this type.

The maximum value which can be inhabited by this type.

Fast exponentation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring

Panics

Panics if the result overflows the type.

Fast exponentation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring

Optimized instructions

Addition which saturates at the maximum value.

Subtraction which underflows and returns a flag if it does.

Subtraction which saturates at zero.

Multiply with overflow, returning a flag if it does.

Multiplication which saturates at the maximum value..

Division with overflow

Modulus with overflow.

Negation with overflow.

Converts from big endian representation bytes in memory Can also be used as (&slice).into(), as it is default From slice implementation for U256

Converts from little endian representation bytes in memory

impl U256
[src]

Multiplies two 256-bit integers to produce full 512-bit integer No overflow possible

Find modular inverse by modulo p

Trait Implementations

impl Copy for U256
[src]

impl Clone for U256
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Eq for U256
[src]

impl PartialEq for U256
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Hash for U256
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Default for U256
[src]

Returns the "default value" for a type. Read more

impl From<u64> for U256
[src]

Performs the conversion.

impl From<u8> for U256
[src]

Performs the conversion.

impl From<u16> for U256
[src]

Performs the conversion.

impl From<u32> for U256
[src]

Performs the conversion.

impl From<usize> for U256
[src]

Performs the conversion.

impl From<i64> for U256
[src]

Performs the conversion.

impl From<i8> for U256
[src]

Performs the conversion.

impl From<i16> for U256
[src]

Performs the conversion.

impl From<i32> for U256
[src]

Performs the conversion.

impl From<isize> for U256
[src]

Performs the conversion.

impl<'a> From<&'a [u8]> for U256
[src]

Performs the conversion.

impl Add<U256> for U256
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Sub<U256> for U256
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Mul<U256> for U256
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Div<U256> for U256
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Rem<U256> for U256
[src]

The resulting type after applying the % operator.

Performs the % operation.

impl BitAnd<U256> for U256
[src]

The resulting type after applying the & operator.

Performs the & operation.

impl BitXor<U256> for U256
[src]

The resulting type after applying the ^ operator.

Performs the ^ operation.

impl BitOr<U256> for U256
[src]

The resulting type after applying the | operator.

Performs the | operation.

impl Not for U256
[src]

The resulting type after applying the ! operator.

Performs the unary ! operation.

impl Shl<usize> for U256
[src]

The resulting type after applying the << operator.

Performs the << operation.

impl Shr<usize> for U256
[src]

The resulting type after applying the >> operator.

Performs the >> operation.

impl Ord for U256
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialOrd for U256
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl From<U256> for U512
[src]

Performs the conversion.

impl From<U512> for U256
[src]

Performs the conversion.

impl<'a> From<&'a U256> for U512
[src]

Performs the conversion.

impl<'a> From<&'a U512> for U256
[src]

Performs the conversion.

impl From<U256> for U128
[src]

Performs the conversion.

impl From<U128> for U256
[src]

Performs the conversion.

impl From<U256> for u64
[src]

Performs the conversion.

impl From<U256> for u32
[src]

Performs the conversion.

impl<'a> From<&'a [u8; 32]> for U256
[src]

Performs the conversion.

impl From<[u8; 32]> for U256
[src]

Performs the conversion.

impl From<U256> for [u8; 32]
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for U256

impl Sync for U256