[][src]Module prefix_num_ops::prim_int

Methods from the PrimInt trait, exposed as free functions.

Functions

count_ones

Returns the number of ones in the binary representation of the input.

count_zeros

Returns the number of zeros in the binary representation of the input.

from_be

Convert an integer from big endian to the target's endianness.

from_le

Convert an integer from little endian to the target's endianness.

leading_zeros

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

pow

Raises a number to the power of exp, using exponentiation by squaring.

rotate_left

Shifts the bits to the left by a specified amount amount, n, wrapping the truncated bits to the end of the resulting integer.

rotate_right

Shifts the bits to the right by a specified amount amount, n, wrapping the truncated bits to the beginning of the resulting integer.

signed_shl

Shifts the bits to the left by a specified amount amount, n, filling zeros in the least significant bits.

signed_shr

Shifts the bits to the right by a specified amount amount, n, copying the "sign bit" in the most significant bits even for unsigned types.

swap_bytes

Reverses the byte order of the integer.

to_be

Convert the input to big endian from the target's endianness.

to_le

Convert the input to little endian from the target's endianness.

trailing_zeros

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

unsigned_shl

Shifts the bits to the left by a specified amount amount, n, filling zeros in the least significant bits.

unsigned_shr

Shifts the bits to the right by a specified amount amount, n, filling zeros in the most significant bits.