Struct bignum::u256 [] [src]

pub struct u256 { /* fields omitted */ }

Stack-allocated arbitrary-precision (up to certain limit) integer.

This is backed by a fixed-size array of given type ("digit"). While the array is not very large (normally some hundred bytes), copying it recklessly may result in the performance hit. Thus this is intentionally not Copy.

All operations available to bignums panic in the case of overflows. The caller is responsible to use large enough bignum types.

Methods

impl u256
[src]

[src]

Makes a bignum from one digit.

[src]

Makes a bignum from u64 value.

[src]

Returns the internal digits as a slice [a, b, c, ...] such that the numeric value is a + b * 2^W + c * 2^(2W) + ... where W is the number of bits in the digit type.

[src]

Returns the i-th bit where bit 0 is the least significant one. In other words, the bit with weight 2^i.

[src]

Returns true if the bignum is zero.

[src]

Returns the number of bits necessary to represent this value. Note that zero is considered to need 0 bits.

impl u256
[src]

MIN: u256 = <u256>::min_value()

The smallest value that can be represented by this integer type.

MAX: u256 = <u256>::max_value()

The largest value that can be represented by this integer type.

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Trait Implementations

impl Add<u32> for u256
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl AddAssign<u32> for u256
[src]

[src]

Performs the += operation.

impl Add<u256> for u256
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl AddAssign<u256> for u256
[src]

[src]

Performs the += operation.

impl Sub<u256> for u256
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl SubAssign<u256> for u256
[src]

[src]

Performs the -= operation.

impl Mul<u32> for u256
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<u256> for u256
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl MulAssign<u32> for u256
[src]

[src]

Performs the *= operation.

impl MulAssign<u256> for u256
[src]

[src]

Performs the *= operation.

impl Rem<u32> for u256
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl RemAssign<u32> for u256
[src]

[src]

Performs the %= operation.

impl Rem<u256> for u256
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl RemAssign<u256> for u256
[src]

[src]

Performs the %= operation.

impl Div<u32> for u256
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl DivAssign<u32> for u256
[src]

[src]

Performs the /= operation.

impl Div<u256> for u256
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl DivAssign<u256> for u256
[src]

[src]

Performs the /= operation.

impl Not for u256
[src]

The resulting type after applying the ! operator.

[src]

Performs the unary ! operation.

impl PartialEq for u256
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl Eq for u256
[src]

impl PartialOrd for u256
[src]

[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

impl Ord for u256
[src]

[src]

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

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Display for u256
[src]

[src]

Formats the value using the given formatter. Read more

impl Debug for u256
[src]

[src]

Formats the value using the given formatter. Read more

impl LowerHex for u256
[src]

[src]

Formats the value using the given formatter.

impl UpperHex for u256
[src]

[src]

Formats the value using the given formatter.

impl Binary for u256
[src]

[src]

Formats the value using the given formatter.

impl Copy for u256
[src]

impl Clone for u256
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<i8> for u256
[src]

[src]

Performs the conversion.

impl From<u8> for u256
[src]

[src]

Performs the conversion.

impl From<i16> for u256
[src]

[src]

Performs the conversion.

impl From<u16> for u256
[src]

[src]

Performs the conversion.

impl From<i32> for u256
[src]

[src]

Performs the conversion.

impl From<u32> for u256
[src]

[src]

Performs the conversion.

impl From<i64> for u256
[src]

[src]

Performs the conversion.

impl From<u64> for u256
[src]

[src]

Performs the conversion.

impl From<isize> for u256
[src]

[src]

Performs the conversion.

impl From<usize> for u256
[src]

[src]

Performs the conversion.

Auto Trait Implementations

impl Send for u256

impl Sync for u256