# Struct primitive_types::U128

source · [−]## Expand description

Little-endian large integer type 128-bit unsigned integer.

## Tuple Fields

`0: [u64; 2]`

## Implementations

Converts a string slice in a given base to an integer. Only supports radixes of 10 and 16.

Convert from a decimal string.

Conversion to u64 with overflow checking

##### Panics

Panics if the number is larger than u64::max_value().

Conversion to usize with overflow checking

##### Panics

Panics if the number is larger than usize::max_value().

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

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

Write to the slice in big-endian format.

Write to the slice in little-endian format.

Compute the highest `n`

such that `n * n <= self`

.

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

##### Panics

Panics if the result overflows the type.

Fast exponentiation by squaring. Returns result and overflow flag.

Checked exponentiation. Returns `None`

if overflow occurred.

Addition which saturates at the maximum value (Self::max_value()).

Checked addition. Returns `None`

if overflow occurred.

Subtraction which underflows and returns a flag if it does.

Subtraction which saturates at zero.

Checked subtraction. Returns `None`

if overflow occurred.

Multiply with overflow, returning a flag if it does.

Multiplication which saturates at the maximum value..

Checked multiplication. Returns `None`

if overflow occurred.

Checked division. Returns `None`

if `other == 0`

.

Checked modulus. Returns `None`

if `other == 0`

.

Checked negation. Returns `None`

unless `self == 0`

.

Converts from big endian representation bytes in memory.

Converts from little endian representation bytes in memory.

## Trait Implementations

Performs the `+=`

operation. Read more

Get a reference to the underlying little-endian words.

Deserialize this value from the given Serde deserializer. Read more

Performs the `/=`

operation. Read more

Upper bound, in bytes, of the maximum encoded size of this item.

Performs the `*=`

operation. Read more

Performs the `*=`

operation. Read more

Performs the `*=`

operation. Read more

Performs the `*=`

operation. Read more

Performs the `*=`

operation. Read more

Performs the `*=`

operation. Read more

Performs the `*=`

operation. Read more

Performs the `*=`

operation. Read more

Performs the `*=`

operation. Read more

Performs the `*=`

operation. Read more

Performs the `*=`

operation. Read more

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

Performs the `%=`

operation. Read more

Performs the `<<=`

operation. Read more

Performs the `>>=`

operation. Read more

Performs the `-=`

operation. Read more

## Auto Trait Implementations

### impl RefUnwindSafe for U128

### impl UnwindSafe for U128

## Blanket Implementations

Mutably borrows from an owned value. Read more