Skip to main content

Integer

Struct Integer 

Source
pub struct Integer<const S: bool, const N: usize, const B: usize = 0, const OM: u8 = {OverflowMode::DEFAULT as u8}> { /* private fields */ }
Expand description

A fixed-size integer type, generic over signedness, bit width, and overflow behaviour.

Integer has four const-generic parameters:

  • S: determines whether the integer behaves as an unsigned integer (S = false), or a signed integer (S = true);
  • N: specifies how many bytes should be used to store the integer. The bytes are stored in little endian order (least significant byte first).
  • B: specifies the bit width of the integer. If B = 0 (the default value), then the bit width of the integer is taken to be N * 8. Otherwise, the bit width is taken to be B, and in this case it is required that N - 8 < B*8 <= N (i.e. N = B.div_ceil(8)).
  • OM: specifies the behaviour of the type when arithmetic overflow occurs. There are three valid overflow modes, each corresponding to a variant of the OverflowMode enum:
    • 0 (Wrap): arithmetic operations wrap around on overflow.
    • 1 (Panic): arithmetic operations panic on overflow.
    • 2 (Saturate): arithmetic operations saturate on overflow.
      By default, OM is set to 0 if the overflow-checks flag is disabled, and 1 if overflow-checks is enabled.

Integer closely follows the API and behaviour of Rust’s primitive integer types: u8, i8, u16, i16, u32, i32, u64, i64, u128, i128, usize and isize. The only differences are:

  • The primitive integers are stored in native-endian byte order. Integers are always stored in little-endian byte order.
  • Primitive integers are serialised in serde as decimal strings. Integers are serialised using derive(Serialize), i.e. as a struct.
  • In no-alloc environments, primitive integers are formatted as decimal strings by the Debug trait, whereas Integers are formatted as padded hexadecimal strings.
  • The primitive integers panic on arithmetic overflow if overflow-checks is enabled, and wrap around on overflow if overflow-checks is disabled. The overflow behaviour of Integer is determined by Self::OVERFLOW_MODE:
    • Wrap: arithmetic operations wrap around on overflow, so the behaviour is the same as the Wrapping(T) type in the standard library (i.e. the same as the primitive integer type behaviour when overflow-checks is disabled).
    • Panic: arithmetic operations panic on overflow, so the behaviour is the same as the primitive integer type behaviour when overflow-checks is enabled.
    • Saturate: arithmetic operations saturate on overflow, so the behaviour is the same as the Saturating(T) type in the standard library.
    • OverflowMode::DEFAULT: the overflow behaviour is the same as the primitive integer type overflow behaviour.

Implementations§

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Associated constants.

Source

pub const OVERFLOW_MODE: OverflowMode

The overflow mode used for this type, determined by the const-generic parameter OM:

§Examples
use bnum::prelude::*;
use bnum::OverflowMode;
 
type U264w = t!(U264w);
type I155p = t!(I155p);
type I512s = t!(I512s);
 
assert_eq!(U264w::OVERFLOW_MODE, OverflowMode::Wrap);
assert_eq!(I155p::OVERFLOW_MODE, OverflowMode::Panic);
assert_eq!(I512s::OVERFLOW_MODE, OverflowMode::Saturate);
Source

pub const BITS: u32

The bit width of the type.

§Examples
use bnum::types::{U512, I1024};
 
assert_eq!(U512::BITS, 512);
assert_eq!(I1024::BITS, 1024);
Source

pub const BYTES: u32

The total number of bytes that this type contains.

§Examples
use bnum::types::{U256, I512};

assert_eq!(U256::BYTES, 32); // 256 / 8 = 32
assert_eq!(I512::BYTES, 64); // 512 / 8 = 64
Source

pub const MIN: Self

The minimum value that this type can represent. For unsigned integers, this is 0. For signed integers, this is -2^(Self::BITS - 1).

§Examples
use bnum::prelude::*;
use bnum::types::{U512, I512};
 
assert_eq!(U512::MIN, n!(0));
assert_eq!(I512::MIN.trailing_zeros(), 511); // memory representation is 100...0
Source

pub const MAX: Self

The maximum value that this type can represent. For unsigned integers, this is 2^Self::BITS - 1. For signed integers, this is 2^(Self::BITS - 1) - 1.

§Examples
use bnum::types::{U256, I256};
 
assert_eq!(U256::MAX.not(), U256::MIN); // memory representation of `Self::MAX` is 111...1
assert_eq!(I256::MAX.not(), I256::MIN); // memory representation of `Self::MAX` is 011...1
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Bigint helper methods: common functions used to implement big integer arithmetic.

Source

pub const fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)

Computes self + rhs + carry, and returns a tuple of the low (wrapping) bits and the high (carry) bit of the result, in that order.

If carry is false, then this method is equivalent to overflowing_add.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};

assert_eq!(n!(1U1024).carrying_add(n!(1), true), (n!(3), false));
assert_eq!(U1024::MAX.carrying_add(n!(1), false), (n!(0), true));
assert_eq!(U1024::MAX.carrying_add(U1024::MAX, true), (U1024::MAX, true));

assert_eq!(n!(1I1024).carrying_add(n!(1), true), (n!(3), false));
assert_eq!(I1024::MAX.carrying_add(n!(0), true), (I1024::MIN, true));
assert_eq!(I1024::MAX.carrying_add(I1024::MAX, true), (n!(-1), true));
assert_eq!(I1024::MIN.carrying_add(I1024::MIN, true), (n!(1), true));
Source

pub const fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)

Computes self - rhs - borrow, and returns a tuple of the low (wrapping) bits of the result and a boolean indicating whether an arithmetic borrow (overflow) occurred.

If borrow is false, then this method is equivalent to overflowing_sub.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};

assert_eq!(n!(2U512).borrowing_sub(n!(1), true), (n!(0), false));
assert_eq!(U512::MIN.borrowing_sub(n!(1), false), (U512::MAX, true));
assert_eq!(U512::MAX.borrowing_sub(U512::MAX, true), (U512::MAX, true));

assert_eq!(n!(1I512).borrowing_sub(n!(1I512), true), (n!(-1I512), false));
assert_eq!(I512::MIN.borrowing_sub(n!(1), false), (I512::MAX, true));
assert_eq!(n!(0).borrowing_sub(I512::MIN, true), (I512::MAX, false));
Source

pub const fn widening_mul(self, rhs: Self) -> (Uint<N, B, OM>, Self)

Computes self * rhs, and returns a tuple of the low (wrapping) bits and high (overflow) bits of the result, in that order.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};

assert_eq!(n!(7U256).widening_mul(n!(3)), (n!(21), n!(0)));
assert_eq!(n!(2U256).pow(255).widening_mul(n!(2U256).pow(100)), (n!(0), n!(2U256).pow(99)));

assert_eq!(n!(-5I256).widening_mul(n!(8)), (n!(-40).cast_unsigned(), n!(-1)));
assert_eq!(I256::MIN.widening_mul(n!(2)), (n!(0), n!(-1)));
Source

pub const fn carrying_mul( self, rhs: Self, carry: Self, ) -> (Uint<N, B, OM>, Self)

Computes self * rhs + carry, and returns a tuple of the low (wrapping) bits and high (overflow) bits of the result, in that order.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};

assert_eq!(n!(7U2048).carrying_mul(n!(3), n!(5)), (n!(26), n!(0)));
assert_eq!(U2048::MAX.carrying_mul(U2048::MAX, U2048::MAX), (n!(0), U2048::MAX));

assert_eq!(n!(-5I2048).carrying_mul(n!(8), n!(-6)), (n!(-46).cast_unsigned(), n!(-1)));
assert_eq!(I2048::MIN.carrying_mul(n!(2), n!(3)), (n!(3), n!(-1)));
Source

pub const fn carrying_mul_add( self, rhs: Self, carry: Self, add: Self, ) -> (Uint<N, B, OM>, Self)

Computes self * rhs + carry + add, and returns a tuple of the low (wrapping) bits and high (overflow) bits of the result, in that order.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};

assert_eq!(n!(7U2048).carrying_mul_add(n!(3), n!(5), n!(12)), (n!(38), n!(0)));
assert_eq!(U2048::MAX.carrying_mul_add(U2048::MAX, U2048::MAX, U2048::MAX), (U2048::MAX, U2048::MAX));

assert_eq!(n!(-5I2048).carrying_mul_add(n!(8), n!(-6), n!(-11)), (n!(-57).cast_unsigned(), n!(-1)));
assert_eq!(I2048::MIN.carrying_mul_add(n!(2), n!(3), n!(-2)), (n!(1), n!(-1)));
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Methods for reading and manipulating the underlying bits of the integer.

Source

pub const fn count_ones(self) -> u32

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

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};

assert_eq!(n!(0b101101U1024).count_ones(), 4);
assert_eq!(U1024::MAX.count_ones(), 1024);
assert_eq!(U1024::MIN.count_ones(), 0);

assert_eq!(n!(0b1110111I1024).count_ones(), 6);
assert_eq!(I1024::MAX.count_ones(), 1023);
assert_eq!(I1024::MIN.count_ones(), 1);
assert_eq!(n!(-1I1024).count_ones(), 1024);
Source

pub const fn count_zeros(self) -> u32

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

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};

assert_eq!(U512::MAX.count_zeros(), 0);
assert_eq!(U512::MIN.count_zeros(), 512);

assert_eq!(I512::MAX.count_zeros(), 1);
assert_eq!(I512::MIN.count_zeros(), 511);
assert_eq!(n!(-1I512).count_zeros(), 0);
Source

pub const fn leading_zeros(self) -> u32

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

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};

assert_eq!(U256::MAX.leading_zeros(), 0);
assert_eq!(U256::MIN.leading_zeros(), 256);
assert_eq!(n!(1U256).leading_zeros(), 255);

assert_eq!(I256::MAX.leading_zeros(), 1);
assert_eq!(I256::MIN.leading_zeros(), 0);
assert_eq!(n!(0I256).leading_zeros(), 256);
Source

pub const fn leading_ones(self) -> u32

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

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};

assert_eq!(U1024::MAX.leading_ones(), 1024);
assert_eq!(n!(0U1024).leading_ones(), 0);
assert_eq!((U1024::MAX << 5u32).leading_ones(), 1019);

assert_eq!(I1024::MIN.leading_ones(), 1);
assert_eq!(I1024::MAX.leading_ones(), 0);
assert_eq!((I1024::MIN >> 10u32).leading_ones(), 11);
Source

pub const fn trailing_ones(self) -> u32

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

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};

assert_eq!(U512::MAX.trailing_ones(), 512);
assert_eq!(n!(0U512).trailing_ones(), 0);
assert_eq!((U512::MAX >> 9u32).trailing_ones(), 503);

assert_eq!(I512::MIN.trailing_ones(), 0);
assert_eq!(I512::MAX.trailing_ones(), 511);
assert_eq!((I512::MAX >> 6u32).trailing_ones(), 505);
Source

pub const fn trailing_zeros(self) -> u32

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

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};

assert_eq!(U2048::MAX.trailing_zeros(), 0);
assert_eq!(n!(0U2048).trailing_zeros(), 2048);
assert_eq!(U2048::power_of_two(279).trailing_zeros(), 279);

assert_eq!(I2048::MAX.trailing_zeros(), 0);
assert_eq!(I2048::MIN.trailing_zeros(), 2047);
assert_eq!(n!(-16I2048).trailing_zeros(), 4);
Source

pub const fn rotate_left(self, n: u32) -> Self

Rotates the bits of self to the left by n places.

§Examples

Basic usage:

use bnum::prelude::*;

type U24 = Uint<3>;
type I24 = Int<3>;

let a: U24 = n!(0x3D2A17);
assert_eq!(a.rotate_left(12), n!(0xA173D2));

let b: I24 = n!(0x7C34AE);
assert_eq!(b.rotate_left(8), n!(0x34AE7C));
Source

pub const fn rotate_right(self, n: u32) -> Self

Rotates the bits of self to the right by n places.

§Examples

Basic usage:

use bnum::prelude::*;

type U24 = Uint<3>;
type I24 = Int<3>;

let a: U24 = n!(0x8427AB);
assert_eq!(a.rotate_right(4), 0xB8427A.as_());

let b: I24 = n!(0x4ACD8A);
assert_eq!(b.rotate_right(16), 0xCD8A4A.as_());
Source

pub const fn unbounded_shl(self, rhs: u32) -> Self

Left-shifts self by rhs bits. If rhs is larger than or equal to Self::BITS, the entire value is shifted out and zero is returned.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};

assert_eq!(n!(1U2048).unbounded_shl(1), n!(2));
assert_eq!(U2048::MAX.unbounded_shl(2048), n!(0));
assert_eq!(U2048::MAX.unbounded_shl(2049), n!(0));

assert_eq!(n!(1).unbounded_shl(2047), I2048::MIN);
assert_eq!(I2048::MAX.unbounded_shl(2048), n!(0));
assert_eq!(I2048::MIN.unbounded_shl(2049), n!(0));
Source

pub const fn unbounded_shr(self, rhs: u32) -> Self

Right-shifts self by rhs bits. If rhs is larger than or equal to Self::BITS, then the entire value is shifted out, and:

  • for unsigned integers, 0 is returned.
  • for signed integers, -1 is returned if self is negative, and 0 is returned if self is non-negative.
§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};

assert_eq!(n!(2U1024).unbounded_shr(1), n!(1));
assert_eq!(U1024::MAX.unbounded_shr(1024), n!(0));
assert_eq!(U1024::MAX.unbounded_shr(1030), n!(0));

assert_eq!(I1024::MIN.unbounded_shr(1023), n!(-1));
assert_eq!(n!(-1I1024).unbounded_shr(1024), n!(-1));
assert_eq!(I1024::MAX.unbounded_shr(1025), n!(0));
Source

pub const fn reverse_bits(self) -> Self

Reverses the order of the bits of self.

§Examples

Basic usage:

use bnum::prelude::*;

type U24 = Uint<3>;
type I24 = Int<3>;

let a: U24 = 0b10110011_11001010_00011101.as_();
assert_eq!(a.reverse_bits(), 0b10111000_01010011_11001101.as_());

let b: I24 = 0b01101001_00111100_11100011.as_();
assert_eq!(b.reverse_bits(), 0b11000111_00111100_10010110.as_());
Source

pub const fn bit(&self, index: u32) -> bool

Returns a boolean representing the bit in the given position (true if the bit is 1). The least significant bit is at index 0, the most significant bit is at index Self::BITS - 1.

§Examples

Basic usage:

use bnum::prelude::*;

let a = n!(0b1101001101U24);
for i in [0, 2, 3, 6, 8, 9] {
    assert!(a.bit(i));
}

let b = n!(0b0010110010I24);
for i in [1, 4, 5, 7] {
    assert!(b.bit(i));
}
Source

pub const fn set_bit(&mut self, index: u32, value: bool)

Sets/unsets the bit in the given position (i.e. to 1 if value is true). The least significant bit is at index 0, the most significant bit is at index Self::BITS - 1.

§Examples

Basic usage:

use bnum::prelude::*;

let mut a = n!(0b1001011001001U24);
a.set_bit(2, true);
assert_eq!(a, n!(0b1001011001101));
a.set_bit(1, false); // no change
assert_eq!(a, n!(0b1001011001101));

let mut b = n!(0b010010110110100I24);
b.set_bit(4, false);
assert_eq!(b, n!(0b010010110100100));
b.set_bit(0, false); // no change
assert_eq!(b, n!(0b010010110100100));
Source§

impl<const S: bool, const N: usize, const OM: u8> Integer<S, N, 0, OM>

Methods for reading and manipulating the underlying bits of the integer.

Source

pub const fn swap_bytes(self) -> Self

Reverses the order of the bytes of self.

§Examples

Basic usage:

use bnum::prelude::*;

type U24 = Uint<3>;
type I24 = Int<3>;

let a: U24 = n!(0x7C283D);
assert_eq!(a.swap_bytes(), n!(0x3D287C));

let b: I24 = n!(0x1DC87B);
assert_eq!(b.swap_bytes(), n!(0x7BC81D));
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<false, N, B, OM>

(Unsigned integers only.) Methods for reading and manipulating the underlying bits of the integer.

Source

pub const fn bit_width(self) -> u32

Returns the smallest number of bits necessary to represent self.

This is equal to the size of the type in bits minus the leading zeros of self.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::U256;

assert_eq!(U256::MAX.bit_width(), 256);
assert_eq!(n!(0U256).bit_width(), 0);
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Methods that convert integers to and from byte arrays and slices.

Source

pub const fn to_bytes(self) -> [u8; N]

Returns the underlying bytes of self as an array.

This method is equivalent to to_le_bytes.

§Examples

Basic usage:

use bnum::prelude::*;
 
let a = n!(0xE3BD89U24);
assert_eq!(a.to_bytes(), [0x89, 0xBD, 0xE3]);
 
let b = n!(0x0A412FI24);
assert_eq!(b.to_bytes(), [0x2F, 0x41, 0x0A]);
Source

pub const fn as_bytes(&self) -> &[u8; N]

Returns a reference to underlying bytes of self.

§Examples

Basic usage:

use bnum::prelude::*;
 
let a = n!(0xD1FB70U24);
assert_eq!(a.as_bytes(), &[0x70, 0xFB, 0xD1]);
 
let b = n!(0x3F23A1I24);
assert_eq!(b.as_bytes(), &[0xA1, 0x23, 0x3F]);
Source

pub const fn as_bytes_mut(&mut self) -> &mut [u8; N]

Returns a mutable reference to underlying bytes of self.

§Examples

Basic usage:

use bnum::prelude::*;
 
let mut a = n!(0xD1FB70U24);
let bytes = a.as_bytes_mut();
bytes[0] = 0x3D;
bytes[2] = 0xA5;
assert_eq!(a, n!(0xA5FB3D));
 
let mut b = n!(0x1D3C4EI24);
let bytes = b.as_bytes_mut();
bytes[1] = 0xFF;
assert_eq!(b, n!(0x1DFF4E));
Source

pub const fn from_bytes(digits: [u8; N]) -> Self

Creates a new integer from the given array of bytes. The first byte in the array is interpreted as the least significant byte, the last byte in the array is interpreted as the most significant byte.

If Self::BITS is not a multiple of 8, then the high-order bits are ignored.

This method is equivalent to from_le_bytes.

§Examples

Basic usage:

use bnum::prelude::*;
 
type U24 = Uint<3>;
type I24 = Int<3>;
type U15 = t!(U15);
 
let bytes = [0x56, 0x34, 0x12];
assert_eq!(U24::from_bytes(bytes), n!(0x123456));
 
let bytes = [0xFE, 0xDC, 0x7B];
assert_eq!(I24::from_bytes(bytes), n!(0x7BDCFE));
 
assert_eq!(U15::from_bytes([0xFF, 0xFF]), U15::MAX); // = 0x7FFF. the high-order bit is ignored
Source

pub const fn from_be_slice(slice: &[u8]) -> Option<Self>

Converts the slice of big endian bytes to an integer. An empty slice is interpreted as zero. If the value represented by the bytes is too large to be stored in Self, then None is returned.

§Examples
use bnum::prelude::*;
 
type U24 = Uint<3>;
type I24 = Int<3>;
 
let a: U24 = n!(0x005CF1);
 
let b = U24::from_be_slice(&[0x00, 0x5C, 0xF1]);
assert_eq!(b, Some(a));
 
let c = U24::from_be_slice(&[0x00, 0x00, 0x5C, 0xF1]);
assert_eq!(c, Some(a));

let d = U24::from_be_slice(&[0x00, 0x00, 0x00, 0x5C, 0xF1]);
assert_eq!(d, Some(a));
 
let e = U24::from_be_slice(&[0x01, 0x00, 0x5C, 0xF1]);
assert_eq!(e, None);
 
let a: I24 = n!(0xFF8A06).cast_signed();
assert!(a.is_negative());
 
let b = I24::from_be_slice(&[0xFF, 0x8A, 0x06]);
assert_eq!(b, Some(a));
 
let c = I24::from_be_slice(&[0xFF, 0xFF, 0x8A, 0x06]);
assert_eq!(c, Some(a));
 
let d = I24::from_be_slice(&[0xFF, 0xFF, 0xFF, 0x8A, 0x06]);
assert_eq!(d, Some(a));
 
let e = I24::from_be_slice(&[0xFE, 0xFF, 0x8A, 0x06]);
assert_eq!(e, None);
Source

pub const fn from_le_slice(slice: &[u8]) -> Option<Self>

Converts the slice of little endian bytes to an integer. An empty slice is interpreted as zero. If the value represented by the bytes is too large to be stored in Self, then None is returned.

§Examples
use bnum::prelude::*;
 
type U24 = Uint<3>;
type I24 = Int<3>;
 
let a: U24 = n!(0x005CF1);
let b = U24::from_le_slice(&[0xF1, 0x5C, 0x00]);
assert_eq!(b, Some(a));
 
let c = U24::from_le_slice(&[0xF1, 0x5C]);
assert_eq!(c, Some(a));

let d = U24::from_le_slice(&[0xF1, 0x5C, 0x00, 0x00, 0x00]);
assert_eq!(d, Some(a));

let e = U24::from_le_slice(&[0xF1, 0x5C, 0x00, 0x01]);
assert_eq!(e, None);
 
let a: I24 = n!(0xFF8A06).cast_signed();
assert!(a.is_negative());
 
let b = I24::from_le_slice(&[0x06, 0x8A, 0xFF]);
assert_eq!(b, Some(a));
 
let c = I24::from_le_slice(&[0x06, 0x8A]); // 0x8A has a leading one, so the slice represents a negative number
assert_eq!(c, Some(a));

let d = I24::from_le_slice(&[0x06, 0x8A, 0xFF, 0xFF, 0xFF]);
assert_eq!(d, Some(a));

let e = I24::from_le_slice(&[0x06, 0x8A, 0xFF, 0xFE]);
assert_eq!(e, None);
Source§

impl<const S: bool, const N: usize, const OM: u8> Integer<S, N, 0, OM>

Source

pub const fn to_be_bytes(self) -> [u8; N]

Returns the representation of self as a byte array in big-endian order.

§Examples

Basic usage:

use bnum::prelude::*;
 
type U24 = Uint<3>;
type I24 = Int<3>;
 
let a: U24 = n!(0x3B2C4E);
assert_eq!(a.to_be_bytes(), [0x3B, 0x2C, 0x4E]);
 
let b: I24 = n!(0xFF8A06).cast_signed();
assert_eq!(b.to_be_bytes(), [0xFF, 0x8A, 0x06]);
Source

pub const fn to_le_bytes(self) -> [u8; N]

Returns the representation of self as a byte array in little-endian order.

§Examples

Basic usage:

use bnum::prelude::*;
 
type U24 = Uint<3>;
type I24 = Int<3>;
 
let a: U24 = n!(0x6FABD7);
assert_eq!(a.to_le_bytes(), [0xD7, 0xAB, 0x6F]);
 
let b: I24 = n!(0x6F75FF);
assert_eq!(b.to_le_bytes(), [0xFF, 0x75, 0x6F]);
Source

pub const fn from_be_bytes(bytes: [u8; N]) -> Self

Creates an integer value from a byte array in big-endian order.

§Examples

Basic usage:

use bnum::prelude::*;
 
type U24 = Uint<3>;
type I24 = Int<3>;
 
let bytes = [0x3B, 0x2C, 0x4E];
assert_eq!(U24::from_be_bytes(bytes), n!(0x3B2C4E));
 
let bytes = [0x06, 0x8A, 0xFF];
assert_eq!(I24::from_be_bytes(bytes), n!(0x068AFF));
Source

pub const fn from_le_bytes(bytes: [u8; N]) -> Self

Creates an integer value from a byte array in little-endian order.

§Examples

Basic usage:

use bnum::prelude::*;
 
type U24 = Uint<3>;
type I24 = Int<3>;
 
let bytes = [0xD7, 0xAB, 0x6F];
assert_eq!(U24::from_le_bytes(bytes), n!(0x6FABD7));
 
let bytes = [0xFF, 0x75, 0x6F];
assert_eq!(I24::from_le_bytes(bytes), n!(0x6F75FF));
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Checked arithmetic methods which act on self: self.checked_.... Each method cannot panic and returns an Option<Self>. None is returned when overflow would have occurred or there was an attempt to divide by zero or calculate a remainder with a divisor of zero.

Source

pub const fn checked_add(self, rhs: Self) -> Option<Self>

Checked integer addition. Computes self + rhs, returning None if overflow occurred.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};

assert_eq!(n!(1U1024).checked_add(n!(1)), Some(n!(2)));
assert_eq!(U1024::MAX.checked_add(n!(1)), None);
 
assert_eq!(n!(1I1024).checked_add(n!(-1)), Some(n!(0)));
assert_eq!(I1024::MIN.checked_add(n!(-1)), None);
Source

pub const fn checked_sub(self, rhs: Self) -> Option<Self>

Checked integer subtraction. Computes self - rhs, returning None if overflow occurred.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};
 
assert_eq!(n!(1U256).checked_sub(n!(1)), Some(n!(0)));
assert_eq!(U256::MIN.checked_sub(n!(1)), None);
 
assert_eq!(n!(-1I256).checked_sub(n!(1)), Some(n!(-2)));
assert_eq!(I256::MAX.checked_sub(n!(-1)), None);
Source

pub const fn checked_mul(self, rhs: Self) -> Option<Self>

Checked integer multiplication. Computes self * rhs, returning None if overflow occurred.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};
 
assert_eq!(n!(1U512).checked_mul(n!(1)), Some(n!(1)));
assert_eq!(U512::MAX.checked_mul(n!(3)), None);
 
assert_eq!(n!(2I512).checked_mul(n!(3)), Some(n!(6)));
assert_eq!(I512::MIN.checked_mul(n!(-1)), None);
Source

pub const fn checked_div(self, rhs: Self) -> Option<Self>

Checked integer division. Computes self / rhs, returning None if rhs is zero, or if the division would overflow (this is only possible for signed integers).

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};
 
assert_eq!(n!(5U256).checked_div(n!(2)), Some(n!(2)));
assert_eq!(n!(1U256).checked_div(n!(0)), None);
 
assert_eq!(n!(-13I256).checked_div(n!(5)), Some(n!(-2)));
assert_eq!(I256::MIN.checked_div(n!(-1)), None);
Source

pub const fn checked_div_euclid(self, rhs: Self) -> Option<Self>

Checked Euclidean division. Computes self.div_euclid(rhs), returning None if rhs is zero or if the division would overflow (this is only possible for signed integers).

For unsigned integers, this is equivalent to self.checked_div(rhs).

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};
 
assert_eq!(n!(13U2048).checked_div_euclid(n!(5)), Some(n!(2)));
assert_eq!(U2048::MAX.checked_div_euclid(n!(0)), None);
 
assert_eq!(n!(-13I2048).checked_div_euclid(n!(5)), Some(n!(-3)));
assert_eq!(I2048::MIN.checked_div_euclid(n!(-1)), None);
Source

pub const fn checked_rem(self, rhs: Self) -> Option<Self>

Checked integer remainder. Computes self % rhs, returning None if rhs is zero or if computing the remainder would result in overflow (this is only possible for signed integers).

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};
 
assert_eq!(n!(5U1024).checked_rem(n!(2)), Some(n!(1)));
assert_eq!(n!(1U1024).checked_rem(n!(0)), None);
 
assert_eq!(n!(-13I1024).checked_rem(n!(5)), Some(n!(-3)));
assert_eq!(I1024::MIN.checked_rem(n!(-1)), None);
Source

pub const fn checked_rem_euclid(self, rhs: Self) -> Option<Self>

Checked Euclidean remainder. Computes self.rem_euclid(rhs), returning None if rhs is zero or if computing the remainder would result in overflow (this is only possible for signed integers).

For unsigned integers, this is equivalent to self.checked_rem(rhs).

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};
 
assert_eq!(n!(13U512).checked_rem_euclid(n!(5)), Some(n!(3)));
assert_eq!(U512::MAX.checked_rem_euclid(n!(0)), None);
 
assert_eq!(n!(-13I512).checked_rem_euclid(n!(5)), Some(n!(2)));
assert_eq!(I512::MIN.checked_rem_euclid(n!(-1)), None);
Source

pub const fn checked_neg(self) -> Option<Self>

Checked negation. Computes -self, returning None if overflow occurred.

For unsigned integers, overflow occurs if self is non-zero. For signed integers, overflow occurs if self is equal to Self::MIN.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};
 
assert_eq!(n!(1U256).checked_neg(), None);
assert_eq!(n!(0U256).checked_neg(), Some(n!(0)));
 
assert_eq!(n!(1I256).checked_neg(), Some(n!(-1)));
assert_eq!(I256::MIN.checked_neg(), None);
Source

pub const fn checked_shl(self, rhs: u32) -> Option<Self>

Checked left shift. Computes self << rhs, returning None if rhs is greater than or equal to Self::BITS.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};
 
assert_eq!(n!(1U2048).checked_shl(1), Some(n!(2)));
assert_eq!(n!(1U2048).checked_shl(2048), None);
assert_eq!(n!(2U2048).checked_shl(2047), Some(n!(0)));
 
assert_eq!(n!(-1I2048).checked_shl(2), Some(n!(-4)));
assert_eq!(n!(-1I2048).checked_shl(2048), None);
assert_eq!(n!(-1).checked_shl(2047), Some(I2048::MIN));
Source

pub const fn checked_shr(self, rhs: u32) -> Option<Self>

Checked right shift. Computes self >> rhs, returning None if rhs is greater than or equal to Self::BITS.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};

assert_eq!(n!(1U1024).checked_shr(1), Some(n!(0)));
assert_eq!(U1024::MAX.checked_shr(1024), None);
assert_eq!(U1024::MAX.checked_shr(1023), Some(n!(1)));
 
assert_eq!(n!(-1I1024).checked_shr(1), Some(n!(-1)));
assert_eq!(I1024::MIN.checked_shr(1024), None);
assert_eq!(I1024::MIN.checked_shr(I1024::BITS - 1), Some(n!(-1)));
Source

pub const fn checked_pow(self, exp: u32) -> Option<Self>

Checked exponentiation. Computes self.pow(exp), returning None if overflow occurred.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};
 
assert_eq!(n!(2U512).checked_pow(10), Some(n!(1024)));
assert_eq!(n!(2U512).checked_pow(512), None);
 
assert_eq!(n!(-2I512).checked_pow(3), Some(n!(-8)));
assert_eq!(n!(-2).checked_pow(511), Some(I512::MIN));
assert_eq!(n!(2I512).checked_pow(512), None);
Source

pub const fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>

If rhs is positive, computes the smallest integer multiple of rhs that is greater than or equal to self. If rhs is negative, computes the largest integer multiple of rhs that is less than or equal to self.

Returns None if rhs is zero, or if the result is too large or too small to be represented by Self.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};
 
assert_eq!(n!(4U256).checked_next_multiple_of(n!(2)), Some(n!(4)));
assert_eq!(n!(17U256).checked_next_multiple_of(n!(7)), Some(n!(21)));
assert_eq!(n!(1U256).checked_next_multiple_of(n!(0)), None);
assert_eq!(U256::MAX.checked_next_multiple_of(n!(2)), None);
assert_eq!(U256::MAX.checked_next_multiple_of(n!(1)), Some(U256::MAX));
 
assert_eq!(n!(-9I256).checked_next_multiple_of(n!(-3)), Some(n!(-9)));
assert_eq!(n!(-10I256).checked_next_multiple_of(n!(4)), Some(n!(-8)));
assert_eq!(n!(-17I256).checked_next_multiple_of(n!(-4)), Some(n!(-20)));
assert_eq!(n!(83I256).checked_next_multiple_of(n!(-6)), Some(n!(78)));
assert_eq!(I256::MIN.checked_next_multiple_of(n!(2)), Some(I256::MIN));
assert_eq!(n!(0I256).checked_next_multiple_of(n!(3)), Some(n!(0)));
Source

pub const fn checked_ilog2(self) -> Option<u32>

Computes base-2 logarithm of self, rounded down, i.e. the largest integer n such that 2^n <= self.

Returns None if self is less than or equal to zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};
 
assert_eq!(n!(1U2048).checked_ilog2(), Some(0));
assert_eq!(U2048::MAX.checked_ilog2(), Some(2047));
assert_eq!(n!(0U2048).checked_ilog2(), None);
 
assert_eq!(I2048::MAX.checked_ilog2(), Some(2046));
assert_eq!(n!(-1I2048).checked_ilog2(), None);
Source

pub const fn checked_ilog10(self) -> Option<u32>

Computes base-10 logarithm of self, rounded down, i.e. the largest integer n such that 10^n <= self.

Returns None if self is less than or equal to zero.

§Examples

Basic usage:

use bnum::prelude::*;
 
assert_eq!(n!(1U1024).checked_ilog10(), Some(0));
assert_eq!(n!(1000U1024).checked_ilog10(), Some(3));
assert_eq!(n!(0U1024).checked_ilog10(), None);
 
assert_eq!(n!(100I1024).checked_ilog10(), Some(2));
assert_eq!(n!(-1I1024).checked_ilog10(), None);
Source

pub const fn checked_ilog(self, base: Self) -> Option<u32>

Computes logarithm of self to the given base, rounded down, i.e. the largest integer n such that base^n <= self.

Returns None if self is less than or equal to zero, or if base is less than 2.

Note that you should use checked_ilog2 or checked_ilog10 for base-2 or base-10 logarithms, respectively, as they are more efficient.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};
 
assert_eq!(n!(9U512).checked_ilog(n!(3)), Some(2));
assert_eq!(n!(1U512).checked_ilog(n!(1)), None);
assert_eq!(n!(0U512).checked_ilog(n!(0)), None);
 
assert_eq!(n!(65I512).checked_ilog(n!(4)), Some(3));
assert_eq!(n!(2I512).checked_ilog(n!(-1)), None);
assert_eq!(I512::MIN.checked_ilog(n!(2)), None);
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<false, N, B, OM>

(Unsigned integers only.) Checked arithmetic methods which act on self: self.checked_.... Each method cannot panic and returns an Option<Self>. None is returned when overflow would have occurred or there was an attempt to divide by zero or calculate a remainder with a divisor of zero.

Source

pub const fn checked_add_signed(self, rhs: Int<N, B, OM>) -> Option<Self>

Checked addition with a signed integer of the same bit width. Computes self + rhs, returning None if overflow occurred.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::U512;
 
assert_eq!(n!(1U512).checked_add_signed(n!(1)), Some(n!(2)));
assert_eq!(U512::MAX.checked_add_signed(n!(1)), None);
assert_eq!(n!(1U512).checked_add_signed(n!(-2)), None);
Source

pub const fn checked_sub_signed(self, rhs: Int<N, B, OM>) -> Option<Self>

Checked subtraction by a signed integer of the same bit width. Computes self - rhs, returning None if overflow occurred.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::U2048;
 
assert_eq!(n!(1U2048).checked_sub_signed(n!(-1)), Some(n!(2)));
assert_eq!(U2048::MAX.checked_sub_signed(n!(-1)), None);
assert_eq!(n!(1U2048).checked_sub_signed(n!(2)), None);
Source

pub const fn checked_signed_diff(self, rhs: Self) -> Option<Int<N, B, OM>>

Checked integer subtraction. Computes self - rhs, returning None if the result cannot be represented by an Int<N, B, OM>.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::U1024;
 
assert_eq!(n!(1U1024).checked_signed_diff(n!(2)), Some(n!(-1)));
assert_eq!(U1024::MAX.checked_signed_diff(n!(1)), None);
assert_eq!(n!(2U1024).checked_signed_diff(n!(1)), Some(n!(1)));
Source

pub const fn checked_next_power_of_two(self) -> Option<Self>

Computes the smallest power of two that is greater than or equal to self. Returns None if the result is too large to be represented by Self.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::U256;
 
assert_eq!(n!(16U256).checked_next_power_of_two(), Some(n!(16)));
assert_eq!(n!(17U256).checked_next_power_of_two(), Some(n!(32)));
assert_eq!(U256::MAX.checked_next_power_of_two(), None);
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<true, N, B, OM>

(Signed integers only.) Checked arithmetic methods which act on self: self.checked_.... Each method cannot panic and returns an Option<Self>. None is returned when overflow would have occurred or there was an attempt to divide by zero or calculate a remainder with a divisor of zero.

Source

pub const fn checked_add_unsigned(self, rhs: Uint<N, B, OM>) -> Option<Self>

Checked addition with an unsigned integer of the same bit width. Computes self + rhs, returning None if overflow occurred.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{I512, U512};
 
assert_eq!(n!(-1I512).checked_add_unsigned(n!(1)), Some(n!(0)));
assert_eq!(I512::MIN.checked_add_unsigned(U512::MAX), Some(I512::MAX));
assert_eq!(n!(0I512).checked_add_unsigned(U512::MAX), None);
Source

pub const fn checked_sub_unsigned(self, rhs: Uint<N, B, OM>) -> Option<Self>

Checked subtraction by an unsigned integer of the same bit width. Computes self - rhs, returning None if overflow occurred.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{I1024, U1024};
 
assert_eq!(n!(-1I1024).checked_sub_unsigned(n!(1)), Some(n!(-2)));
assert_eq!(n!(0I1024).checked_sub_unsigned(U1024::MAX), None);
assert_eq!(I1024::MAX.checked_sub_unsigned(U1024::MAX), Some(I1024::MIN));
Source

pub const fn checked_abs(self) -> Option<Self>

Checked absolute value. Computes the absolute value of self, returning None if self is equal to Self::MIN.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::I2048;
 
assert_eq!(n!(-123I2048).checked_abs(), Some(n!(123)));
assert_eq!(n!(456I2048).checked_abs(), Some(n!(456)));
assert_eq!(I2048::MIN.checked_abs(), None);
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Mathematical methods.

Source

pub const fn pow(self, exp: u32) -> Self

Returns self raised to the power of exp.

§Overflow behaviour
§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};

assert_eq!(n!(3U256).pow(5), n!(243));
assert_eq!(n!(-7I256).pow(3), n!(-343));
Source

pub const fn div_euclid(self, rhs: Self) -> Self

Returns the Euclidean quotient of self by rhs.

§Overflow behaviour
§Examples
use bnum::prelude::*;

assert_eq!(n!(37U512).div_euclid(n!(8)), n!(4));
assert_eq!(n!(-37I512).div_euclid(n!(8)), n!(-5));
Source

pub const fn rem_euclid(self, rhs: Self) -> Self

Returns the Euclidean remainder of self by rhs. This is always equivalent to self.strict_rem_euclid(rhs), regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;

assert_eq!(n!(37U1024).rem_euclid(n!(8)), n!(5));
assert_eq!(n!(-37I1024).rem_euclid(n!(-8)), n!(3));
Source

pub const fn is_power_of_two(self) -> bool

Returns true if and only if self == 2^k for some integer k.

§Examples
use bnum::prelude::*;

assert!(n!(16U2048).is_power_of_two());
assert!(!n!(-8I2048).is_power_of_two());
Source

pub const fn midpoint(self, rhs: Self) -> Self

Computes the arithmetic mean of self and rhs, rounded towards zero (i.e. (self + rhs) / 2), without the possibility of overflow.

§Examples
use bnum::prelude::*;

assert_eq!(n!(10U256).midpoint(n!(22)), n!(16));
assert_eq!(n!(12U256).midpoint(n!(21)), n!(16));
assert_eq!(n!(-10I256).midpoint(n!(2)), n!(-4));
assert_eq!(n!(-13I256).midpoint(n!(0)), n!(-6));
Source

pub const fn ilog2(self) -> u32

Computes the base-2 logarithm of self, rounded down, i.e. the largest integer n such that 2^n <= self.

§Panics

This function will panic if self is less than or equal to zero.

§Examples
use bnum::prelude::*;

assert_eq!(n!(16U512).ilog2(), 4);
assert_eq!(n!(20I512).ilog2(), 4);
Source

pub const fn ilog10(self) -> u32

Computes the base-10 logarithm of self, rounded down, i.e. the largest integer n such that 10^n <= self.

§Panics

This function will panic if self is less than or equal to zero.

§Examples
use bnum::prelude::*;

assert_eq!(n!(1000U512).ilog10(), 3);
assert_eq!(n!(9999I512).ilog10(), 3);
Source

pub const fn ilog(self, base: Self) -> u32

Computes logarithm of self to the given base, rounded down, i.e. the largest integer n such that base^n <= self.

Note that you should use ilog2 or ilog10 for base-2 or base-10 logarithms respectively, as these are more efficient.

§Panics

This function will panic if self is less than or equal to zero, or if base is less than 2.

§Examples
use bnum::prelude::*;

assert_eq!(n!(243U1024).ilog(n!(3)), 5);
assert_eq!(n!(124I1024).ilog(n!(5)), 2);
Source

pub const fn abs_diff(self, other: Self) -> Uint<N, B, OM>

Computes the absolute difference between self and other, i.e. |self - other|, without the possibility of overflow.

§Examples
use bnum::prelude::*;

assert_eq!(n!(12U2048).abs_diff(n!(30)), n!(18));
assert_eq!(n!(-12I2048).abs_diff(n!(5)), n!(17));
Source

pub const fn next_multiple_of(self, rhs: Self) -> Self

If rhs is positive, computes the smallest integer multiple of rhs that is greater than or equal to self. If rhs is negative, computes the largest integer multiple of rhs that is less than or equal to self.

§Panics

This function will panic if rhs is zero.

This function will also panic if overflow occurs and Self::OVERFLOW_MODE is Panic.

§Examples
use bnum::prelude::*;

assert_eq!(n!(20U256).next_multiple_of(n!(6)), n!(24));
assert_eq!(n!(0U256).next_multiple_of(n!(5)), n!(0));

assert_eq!(n!(18I256).next_multiple_of(n!(-4)), n!(16));
assert_eq!(n!(-17I256).next_multiple_of(n!(-11)), n!(-22));
Source

pub const fn div_floor(self, rhs: Self) -> Self

Computes the quotient of self by rhs, rounding the result towards negative infinity.

§Panics

This function will panic if rhs is zero. For signed integers, it will also panic if self is Self::MIN and rhs is -1, since this would overflow. This behaviour is not affected by Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;

assert_eq!(n!(37U512).div_floor(n!(8)), n!(4));
assert_eq!(n!(-37I512).div_floor(n!(8)), n!(-5));
Source

pub const fn div_ceil(self, rhs: Self) -> Self

Computes the quotient of self by rhs, rounding the result towards positive infinity.

§Panics

This function will panic if rhs is zero. For signed integers, it will also panic if self is Self::MIN and rhs is -1, since this would overflow. This behaviour is not affected by Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;

assert_eq!(n!(37U512).div_ceil(n!(8)), n!(5));
assert_eq!(n!(-37I512).div_ceil(n!(8)), n!(-4));
Source

pub const fn is_zero(&self) -> bool

Returns whether or not self equals zero.

§Examples
use bnum::prelude::*;

assert!(n!(0U1024).is_zero());
assert!(n!(0I1024).is_zero());

assert!(!n!(1U1024).is_zero());
assert!(!n!(-1I1024).is_zero());
Source

pub const fn is_one(&self) -> bool

Returns whether or not self equals one.

§Examples
use bnum::prelude::*;

assert!(n!(1U2048).is_one());
assert!(n!(1I2048).is_one());

assert!(!n!(0U2048).is_one());
assert!(!n!(-1I2048).is_one());
Source

pub const fn isqrt(self) -> Self

Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<false, N, B, OM>

(Unsigned integers only.) Mathematical methods.

Source

pub const fn cast_signed(self) -> Int<N, B, OM>

Casts self to a signed integer type of the same bit width, leaving the memory representation unchanged.

This is function equivalent to using the As trait to cast self to Int<N, B, OM>.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};

assert_eq!(U256::MAX.cast_signed(), n!(-1I256));
assert_eq!(n!(0U256).cast_signed(), n!(0I256));
Source

pub const fn next_power_of_two(self) -> Self

Returns the smallest power of two greater than or equal to self.

§Panics

This function will panic if Self::OVERFLOW_MODE is Panic and the result would be too large to be represented by Self.

§Examples
use bnum::prelude::*;

assert_eq!(n!(20U256).next_power_of_two(), n!(32));
assert_eq!(n!(16U256).next_power_of_two(), n!(16));
assert_eq!(n!(0U256).next_power_of_two(), n!(1));
Source

pub const fn power_of_two(power: u32) -> Self

Returns an integer whose value is 2.pow(power). This is faster than using a shift left on Self::ONE or using the pow function.

§Panics

This function will panic if power is greater than or equal to Self::BITS.

§Examples
use bnum::prelude::*;
use bnum::types::U256;

assert_eq!(U256::power_of_two(11), n!(1) << 11);
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<true, N, B, OM>

(Signed integers only.) Mathematical methods.

Source

pub const fn cast_unsigned(self) -> Uint<N, B, OM>

Casts self to an unsigned integer type of the same bit width, leaving the memory representation unchanged.

This is function equivalent to using the As trait to cast self to Uint<N, B, OM>.

§Examples
use bnum::prelude::*;
use bnum::types::U512;

assert_eq!(n!(-1).cast_unsigned(), U512::MAX);
assert_eq!(n!(0I512).cast_unsigned(), n!(0U512));
Source

pub const fn unsigned_abs(self) -> Uint<N, B, OM>

Returns the absolute value of self as an unsigned integer.

§Examples
use bnum::prelude::*;
use bnum::types::I1024;

assert_eq!(n!(-20I1024).unsigned_abs(), n!(20));
assert_eq!(n!(15I1024).unsigned_abs(), n!(15));
assert_eq!(I1024::MIN.unsigned_abs(), I1024::MIN.cast_unsigned());
Source

pub const fn abs(self) -> Self

Returns the absolute value of self.

§Overflow behaviour
§Examples
use bnum::prelude::*;

assert_eq!(n!(-20I2048).abs(), n!(20));
assert_eq!(n!(15I2048).abs(), n!(15));
Source

pub const fn signum(self) -> Self

Returns the sign of self as a signed integer, i.e. 1 if self is positive, -1 if self is negative, and 0 if self is zero.

§Examples
use bnum::prelude::*;

assert_eq!(n!(42I256).signum(), n!(1));
assert_eq!(n!(-7I256).signum(), n!(-1));
assert_eq!(n!(0I256).signum(), n!(0));
Source

pub const fn is_positive(self) -> bool

Returns whether or not self is (strictly) positive.

§Examples
use bnum::prelude::*;

assert!(n!(314I512).is_positive());
assert!(!n!(-159I512).is_positive());
assert!(!n!(0I512).is_positive());
Source

pub const fn is_negative(self) -> bool

Returns whether or not self is (strictly) negative.

§Examples
use bnum::prelude::*;

assert!(n!(-271I512).is_negative());
assert!(!n!(828I512).is_negative());
assert!(!n!(0I512).is_negative());
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Overflowing arithmetic methods which act on self: self.overflowing_.... Each method returns a tuple of type (Self, bool) where the first item of the tuple is the result of wrapping variant of the method (self.wrapping_...), and the second item is a boolean which indicates whether overflow would have occurred.

Source

pub const fn overflowing_add(self, rhs: Self) -> (Self, bool)

Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};

assert_eq!(n!(1U1024).overflowing_add(n!(1)), (n!(2), false));
assert_eq!(U1024::MAX.overflowing_add(n!(1)), (n!(0), true));

assert_eq!(I1024::MIN.overflowing_add(n!(-1)), (I1024::MAX, true));
assert_eq!(I1024::MAX.overflowing_add(n!(1)), (I1024::MIN, true));
Source

pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool)

Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};

assert_eq!(n!(1U256).overflowing_sub(n!(1)), (n!(0), false));
assert_eq!(U256::MIN.overflowing_sub(n!(1)), (U256::MAX, true));

assert_eq!(I256::MIN.overflowing_sub(n!(1)), (I256::MAX, true));
assert_eq!(I256::MAX.overflowing_sub(n!(-1)), (I256::MIN, true));
Source

pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool)

Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};

assert_eq!(n!(1U512).overflowing_mul(n!(1)), (n!(1), false));
assert_eq!(U512::power_of_two(511).overflowing_mul(n!(2)), (n!(0), true));

assert_eq!(n!(-3I512).overflowing_mul(n!(-7)), (n!(21), false));
assert_eq!(I512::MIN.overflowing_mul(n!(-1)), (I512::MIN, true));
Source

pub const fn overflowing_div(self, rhs: Self) -> (Self, bool)

Returns a tuple of the division along with a boolean indicating whether overflow occurred. Note that this can only happen for signed integers, when self is Self::MIN and rhs is -1.

§Panics

This function will panic if rhs is zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};

assert_eq!(n!(5U1024).overflowing_div(n!(2)), (n!(2), false));
assert_eq!(n!(-23I1024).overflowing_div(n!(4)), (n!(-5), false));
assert_eq!(I1024::MIN.overflowing_div(n!(-1)), (I1024::MIN, true));
Source

pub const fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool)

Returns a tuple of the Euclidean division along with a boolean indicating whether overflow occurred. Note that this can only happen for signed integers, when self is Self::MIN and rhs is -1.

§Panics

This function will panic if rhs is zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};

assert_eq!(n!(13U2048).overflowing_div_euclid(n!(5)), (n!(2), false));
assert_eq!(n!(-23I2048).overflowing_div_euclid(n!(4)), (n!(-6), false));
assert_eq!(I2048::MIN.overflowing_div_euclid(n!(-1)), (I2048::MIN, true));
Source

pub const fn overflowing_rem(self, rhs: Self) -> (Self, bool)

Returns a tuple of the remainder along with a boolean indicating whether overflow occurred during division. Note that this can only happen for signed integers, when self is Self::MIN and rhs is -1.

§Panics

This function will panic if rhs is zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};

assert_eq!(n!(5U1024).overflowing_rem(n!(2)), (n!(1), false));
assert_eq!(n!(-23I1024).overflowing_rem(n!(4)), (n!(-3), false));
assert_eq!(I1024::MIN.overflowing_rem(n!(-1)), (n!(0), true));
Source

pub const fn overflowing_rem_euclid(self, rhs: Self) -> (Self, bool)

Returns a tuple of the Euclidean remainder along with a boolean indicating whether overflow occurred during division. Note that this can only happen for signed integers, when self is Self::MIN and rhs is -1.

§Panics

This function will panic if rhs is zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};

assert_eq!(n!(13U512).overflowing_rem_euclid(n!(5)), (n!(3), false));
assert_eq!(n!(-23I512).overflowing_rem_euclid(n!(4)), (n!(1), false));
assert_eq!(I512::MIN.overflowing_rem_euclid(n!(-1)), (n!(0), true));
Source

pub const fn overflowing_neg(self) -> (Self, bool)

Returns a tuple of !self + 1 along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

Note that the second item of the tuple will be true if self is not zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};

assert_eq!(n!(1U256).overflowing_neg(), (U256::MAX, true));
assert_eq!(n!(0U256).overflowing_neg(), (n!(0), false));

assert_eq!(n!(1I256).overflowing_neg(), (n!(-1), false));
assert_eq!(I256::MIN.overflowing_neg(), (I256::MIN, true));
Source

pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool)

Returns a tuple of the left shift along with a boolean indicating whether rhs is greater than or equal to Self::BITS. If rhs >= Self::BITS then the returned value is self left-shifted by rhs % Self::BITS.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};

assert_eq!(n!(1U2048).overflowing_shl(1), (n!(2), false));
assert_eq!(n!(1U2048).overflowing_shl(2049), (n!(2), true));
assert_eq!(n!(1U2048).overflowing_shl(2048), (n!(1), true));

assert_eq!(n!(-2I2048).overflowing_shl(3), (n!(-16), false));
assert_eq!(n!(-2I2048).overflowing_shl(2051), (n!(-16), true));
assert_eq!(n!(-2I2048).overflowing_shl(2048), (n!(-2), true));
Source

pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool)

Returns a tuple of the right shift along with a boolean indicating whether rhs is greater than or equal to Self::BITS. If rhs >= Self::BITS then the returned value is self right-shifted by rhs % Self::BITS.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};

assert_eq!(n!(1U1024).overflowing_shr(1), (n!(0), false));
assert_eq!(n!(2U1024).overflowing_shr(1025), (n!(1), true));
assert_eq!(U1024::MAX.overflowing_shr(1024), (U1024::MAX, true));
assert_eq!(U1024::MAX.overflowing_shr(1023), (n!(1), false));

assert_eq!(n!(-4I1024).overflowing_shr(2), (n!(-1), false));
assert_eq!(I1024::MIN.overflowing_shr(1023), (n!(-1), false));
assert_eq!(I1024::MIN.overflowing_shr(1024), (I1024::MIN, true));
Source

pub const fn overflowing_pow(self, exp: u32) -> (Self, bool)

Returns a tuple of the exponentiation along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};

assert_eq!(n!(2U512).overflowing_pow(10), (n!(1024), false));
assert_eq!(n!(2U512).overflowing_pow(512), (n!(0), true));

assert_eq!(n!(-7I512).overflowing_pow(3), (n!(-343), false));
assert_eq!(n!(-2I512).overflowing_pow(511), (I512::MIN, false));
assert_eq!(n!(2I512).overflowing_pow(511), (I512::MIN, true));
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<false, N, B, OM>

(Unsigned integers only.) Overflowing arithmetic methods which act on self: self.overflowing_.... Each method returns a tuple of type (Self, bool) where the first item of the tuple is the result of wrapping variant of the method (self.wrapping_...), and the second item is a boolean which indicates whether overflow would have occurred.

Source

pub const fn overflowing_add_signed(self, rhs: Int<N, B, OM>) -> (Self, bool)

Returns a tuple of the addition (with a signed integer of the same bit width) along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};

assert_eq!(n!(1U512).overflowing_add_signed(n!(1)), (n!(2), false));
assert_eq!(U512::MAX.overflowing_add_signed(n!(1)), (n!(0), true));
assert_eq!(n!(1U512).overflowing_add_signed(n!(-2)), (U512::MAX, true));
Source

pub const fn overflowing_sub_signed(self, rhs: Int<N, B, OM>) -> (Self, bool)

Returns a tuple of the subtraction (with a signed integer of the same bit width) along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};

assert_eq!(n!(1U2048).overflowing_sub_signed(n!(-1)), (n!(2), false));
assert_eq!(U2048::MAX.overflowing_sub_signed(n!(-1)), (n!(0), true));
assert_eq!(n!(1U2048).overflowing_sub_signed(n!(2)), (U2048::MAX, true));
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<true, N, B, OM>

(Signed integers only.) Overflowing arithmetic methods which act on self: self.overflowing_.... Each method returns a tuple of type (Self, bool) where the first item of the tuple is the result of wrapping variant of the method (self.wrapping_...), and the second item is a boolean which indicates whether overflow would have occurred.

Source

pub const fn overflowing_add_unsigned(self, rhs: Uint<N, B, OM>) -> (Self, bool)

Returns a tuple of the subtraction (with an unsigned integer of the same bit width) along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};

assert_eq!(n!(-1I256).overflowing_add_unsigned(n!(1)), (n!(0), false));
assert_eq!(I256::MAX.overflowing_add_unsigned(n!(1)), (I256::MIN, true));
assert_eq!(I256::MIN.overflowing_add_unsigned(U256::MAX), (I256::MAX, false));
Source

pub const fn overflowing_sub_unsigned(self, rhs: Uint<N, B, OM>) -> (Self, bool)

Returns a tuple of the subtraction (with an unsigned integer of the same bit width) along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

§Examples
use bnum::prelude::*;
use bnum::types::{U512, I512};

assert_eq!(n!(1I512).overflowing_sub_unsigned(n!(1)), (n!(0), false));
assert_eq!(I512::MIN.overflowing_sub_unsigned(n!(1)), (I512::MAX, true));
assert_eq!(I512::MAX.overflowing_sub_unsigned(U512::MAX), (I512::MIN, false));
Source

pub const fn overflowing_abs(self) -> (Self, bool)

Returns a tuple of the absolute value of self along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned (this can only happen when self equals Self::MIN, in which case Self::MIN is returned).

§Examples
use bnum::prelude::*;
use bnum::types::I1024;

assert_eq!(n!(-123I1024).overflowing_abs(), (n!(123), false));
assert_eq!(n!(456I1024).overflowing_abs(), (n!(456), false));
assert_eq!(I1024::MIN.overflowing_abs(), (I1024::MIN, true));
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<false, N, B, OM>

Methods which convert to integers from strings and lists of digits in a given radix (base).

Source

pub const fn from_radix_be(buf: &[u8], radix: u32) -> Option<Self>

Converts a slice of big-endian digits in the given radix to an integer. Each u8 of the slice is interpreted as one digit of base radix of the number, so this function will return None if any digit is greater than or equal to radix, or if the integer represented by the digits is too large to be represented by Self. Otherwise, the integer is wrapped in Some.

§Panics

This function panics if radix is not in the range from 2 to 256 inclusive.

§Examples
use bnum::prelude::*;
use bnum::types::U512;

let a = U512::from_radix_be(&[4, 3, 2, 1], 11).unwrap();
let b: U512 = n!(1)*n!(11).pow(0) + n!(2)*n!(11).pow(1) + n!(3)*n!(11).pow(2) + n!(4)*n!(11).pow(3);

assert_eq!(a, b); // 4*11^3 + 3*11^2 + 2*11^1 + 1*11^0
Source

pub const fn from_radix_le(buf: &[u8], radix: u32) -> Option<Self>

Converts a slice of little-endian digits in the given radix to an integer. Each u8 of the slice is interpreted as one digit of base radix of the number, so this function will return None if any digit is greater than or equal to radix, or if the integer represented by the digits is too large to be represented by Self. Otherwise, the integer is wrapped in Some.

§Panics

This function panics if radix is not in the range from 2 to 256 inclusive.

§Examples
use bnum::prelude::*;
use bnum::types::U512;

let a = U512::from_radix_le(&[5, 6, 7, 8], 18).unwrap();
let b: U512 = n!(5)*n!(18).pow(0) + n!(6)*n!(18).pow(1) + n!(7)*n!(18).pow(2) + n!(8)*n!(18).pow(3);

assert_eq!(a, b); // 8*18^3 + 7*18^2 + 6*18^1 + 5*18^0
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Source

pub const fn from_str_radix( src: &str, radix: u32, ) -> Result<Self, ParseIntError>

Converts a string slice in a given base to an integer.

The string is expected to be an optional + (or - if the integer is signed) sign followed by digits. Leading and trailing whitespace represent an error. Underscores (which are accepted in Rust literals) also represent an error.

Digits are a subset of these characters, depending on radix:

  • 0-9
  • a-z
  • A-Z
§Panics

This function panics if radix is not in the range from 2 to 36 inclusive.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};

assert_eq!(U512::from_str_radix("A", 16), Ok(n!(10)));
assert_eq!(I512::from_str_radix("-B", 16), Ok(n!(-11)));
Source

pub const fn from_ascii(src: &[u8]) -> Result<Self, ParseIntError>

Parses an integer from an ASCII-byte slice with decimal digits.

The characters are expected to be an optional + (or - if the integer is signed) sign followed by only digits. Leading and trailing non-digit characters (including whitespace) represent an error. Underscores (which are accepted in Rust literals) also represent an error.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};

assert_eq!(U512::from_ascii(b"+10"), Ok(n!(10U512)));
assert_eq!(I512::from_ascii(b"-1234"), Ok(n!(-1234I512)));
Source

pub const fn from_ascii_radix( src: &[u8], radix: u32, ) -> Result<Self, ParseIntError>

Parses an integer from an ASCII-byte slice with digits in a given base.

The characters are expected to be an optional + sign followed by only digits. Leading and trailing non-digit characters (including whitespace) represent an error. Underscores (which are accepted in Rust literals) also represent an error.

Digits are a subset of these characters, depending on radix:

  • 0-9
  • a-z
  • A-Z
§Panics

This function panics if radix is not in the range from 2 to 36 inclusive.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};

assert_eq!(U512::from_ascii_radix(b"A", 16), Ok(n!(10)));
assert_eq!(I512::from_ascii_radix(b"-C", 16), Ok(n!(-12)));
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<false, N, B, OM>

(Unsigned integers only.) Methods which convert integers to strings and lists of digits in a given radix (base).

Source

pub fn to_radix_be(&self, radix: u32) -> Vec<u8>

Available on crate feature alloc only.

Returns the integer in the given base in big-endian digit order.

§Panics

This function panics if radix is not in the range from 2 to 256 inclusive.

use bnum::types::U512;

let digits = &[3, 55, 60, 100, 5, 0, 5, 88];
let n = U512::from_radix_be(digits, 120).unwrap();
assert_eq!(n.to_radix_be(120), digits);
Source

pub fn to_radix_le(&self, radix: u32) -> Vec<u8>

Available on crate feature alloc only.

Returns the integer in the given base in little-endian digit order.

§Panics

This function panics if radix is not in the range from 2 to 256 inclusive.

use bnum::types::U512;

let digits = &[1, 67, 88, 200, 55, 68, 87, 120, 178];
let n = U512::from_radix_le(digits, 250).unwrap();
assert_eq!(n.to_radix_le(250), digits);
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Source

pub fn to_str_radix(&self, radix: u32) -> String

Available on crate feature alloc only.

Returns the integer as a string in the given radix.

§Panics

This function panics if radix is not in the range from 2 to 36 inclusive.

§Examples
use bnum::prelude::*;
use bnum::types::{U512, I512};

let src = "abcdefghijklmnopqrstuvwxyz";
let n = U512::from_str_radix(src, 36).unwrap();
assert_eq!(n.to_str_radix(36), src);
 
let a: I512 = n!(-0o123456701234567);
assert_eq!(a.to_str_radix(8), "-123456701234567");
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Saturating arithmetic methods which act on self: self.saturating_.... For each method, if overflow occurs, the largest or smallest value that can be represented by Self is returned instead.

Source

pub const fn saturating_add(self, rhs: Self) -> Self

Saturating integer addition. Computes self + rhs, returning Self::MAX if the result is too large to be represented by Self, or Self::MIN if the result is too small to be represented by Self.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};
 
assert_eq!(n!(1U1024).saturating_add(n!(1)), n!(2));
assert_eq!(U1024::MAX.saturating_add(U1024::MAX), U1024::MAX);
 
assert_eq!(I1024::MIN.saturating_add(n!(-1)), I1024::MIN);
assert_eq!(I1024::MAX.saturating_add(n!(1)), I1024::MAX);
Source

pub const fn saturating_sub(self, rhs: Self) -> Self

Saturating integer subtraction. Computes self - rhs, returning Self::MAX if the result is too large to be represented by Self, or Self::MIN if the result is too small to be represented by Self.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};
 
assert_eq!(n!(1U256).saturating_sub(n!(1)), n!(0));
assert_eq!(n!(1U256).saturating_sub(n!(2)), n!(0));
 
assert_eq!(I256::MIN.saturating_sub(I256::MAX), I256::MIN);
assert_eq!(I256::MAX.saturating_sub(n!(-1)), I256::MAX);
Source

pub const fn saturating_mul(self, rhs: Self) -> Self

Saturating integer multiplication. Computes self * rhs, returning Self::MAX if the result is too large to be represented by Self, or Self::MIN if the result is too small to be represented by Self.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};
 
assert_eq!(n!(1U1024).saturating_mul(n!(1)), n!(1));
assert_eq!(U1024::MAX.saturating_mul(n!(2)), U1024::MAX);
 
assert_eq!(I1024::MIN.saturating_mul(n!(2)), I1024::MIN);
assert_eq!(I1024::MAX.saturating_mul(n!(3)), I1024::MAX);
Source

pub const fn saturating_div(self, rhs: Self) -> Self

Saturating integer division. The only time the result can saturate is if the integer is signed, and self is Self::MIN and rhs is -1, in which case the result is Self::MAX.

§Panics

This function will panic if rhs is zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::I512;
 
assert_eq!(n!(5U512).saturating_div(n!(2)), n!(2));
assert_eq!(I512::MIN.saturating_div(n!(-1)), I512::MAX);
Source

pub const fn saturating_div_euclid(self, rhs: Self) -> Self

Saturating Euclidean integer division. The only time the result can saturate is if the integer is signed, and self is Self::MIN and rhs is -1, in which case the result is Self::MAX.

§Panics

This function will panic if rhs is zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::I512;
 
assert_eq!(n!(19U512).saturating_div_euclid(n!(5)), n!(3));
assert_eq!(I512::MIN.saturating_div_euclid(n!(-1)), I512::MAX);
Source

pub const fn saturating_pow(self, exp: u32) -> Self

Saturating exponentiation. Computes self.pow(exp), returning Self::MAX if the result is too large to be represented by Self, or Self::MIN if the result is too small to be represented by Self.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};
 
assert_eq!(n!(2U256).saturating_pow(8), n!(256));
assert_eq!(n!(2U256).saturating_pow(256), U256::MAX);
 
assert_eq!(n!(-2I256).saturating_pow(257), I256::MIN);
assert_eq!(n!(-2I256).saturating_pow(256), I256::MAX);
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<false, N, B, OM>

(Unsigned integers only.) Saturating arithmetic methods which act on self: self.saturating_.... For each method, if overflow occurs, the largest or smallest value that can be represented by Self is returned instead.

Source

pub const fn saturating_add_signed(self, rhs: Int<N, B, OM>) -> Self

Saturating addition with a signed integer of the same bit width. Computes self + rhs, returning Self::MAX if the result is too large to be represented by Self, or Self::MIN if the result is negative.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::U512;
 
assert_eq!(n!(1U512).saturating_add_signed(n!(-1)), n!(0));
assert_eq!(U512::MAX.saturating_add_signed(n!(1)), U512::MAX);
assert_eq!(n!(1U512).saturating_add_signed(n!(-2)), n!(0));
Source

pub const fn saturating_sub_signed(self, rhs: Int<N, B, OM>) -> Self

Saturating subtraction with a signed integer of the same bit width. Computes self - rhs, returning Self::MIN if the result is negative, or Self::MAX if the result is too large to be represented by Self.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::U2048;
 
assert_eq!(n!(1U2048).saturating_sub_signed(n!(-1)), n!(2));
assert_eq!(U2048::MAX.saturating_sub_signed(n!(-4)), U2048::MAX);
assert_eq!(n!(1U2048).saturating_sub_signed(n!(3)), n!(0));
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<true, N, B, OM>

(Signed integers only.) Saturating arithmetic methods which act on self: self.saturating_.... For each method, if overflow occurs, the largest or smallest value that can be represented by Self is returned instead.

Source

pub const fn saturating_add_unsigned(self, rhs: Uint<N, B, OM>) -> Self

Saturating addition with an unsigned integer of the same bit width. Computes self + rhs, returning Self::MAX if the result is too large to be represented by Self.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{I512, U512};
 
assert_eq!(n!(-1I512).saturating_add_unsigned(n!(1)), n!(0));
assert_eq!(n!(0I512).saturating_add_unsigned(U512::MAX), I512::MAX);
Source

pub const fn saturating_sub_unsigned(self, rhs: Uint<N, B, OM>) -> Self

Saturating subtraction with an unsigned integer of the same bit width. Computes self + rhs, returning Self::MIN if the result is too small to be represented by Self.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::I1024;
 
assert_eq!(n!(1I1024).saturating_sub_unsigned(n!(1)), n!(0));
assert_eq!(I1024::MIN.saturating_sub_unsigned(n!(1)), I1024::MIN);
Source

pub const fn saturating_abs(self) -> Self

Computes the absolute value of self, returning Self::MAX if the result is too large to be represented by Self. The only time this can happen is if self is Self::MIN.

§Examples
use bnum::prelude::*;
use bnum::types::I2048;
 
assert_eq!(n!(-7I2048).saturating_abs(), n!(7));
assert_eq!(n!(22I2048).saturating_abs(), n!(22));
assert_eq!(I2048::MIN.saturating_abs(), I2048::MAX);
Source

pub const fn saturating_neg(self) -> Self

Saturating negation. Computes -self, returning Self::MAX if the result is too large to be represented by Self. The only time this can happen is if self is Self::MIN.

§Examples
use bnum::prelude::*;
use bnum::types::I256;
 
assert_eq!(n!(7I256).saturating_neg(), n!(-7));
assert_eq!(n!(-22I256).saturating_neg(), n!(22));
assert_eq!(I256::MIN.saturating_neg(), I256::MAX);
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Strict arithmetic methods which act on self: self.strict_.... Each method will always panic if overflow or division by zero occurs (i.e. when the checked equivalent would return None), regardless of Self::OVERFLOW_MODE.

Source

pub const fn strict_add(self, rhs: Self) -> Self

Strict integer addition. Computes self + rhs, panicking if overflow occurs.

§Panics

This function will panic if overflow occurs, regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(2U24).strict_add(n!(3U24)), n!(5U24));
assert_eq!(n!(-2I24).strict_add(n!(-3I24)), n!(-5I24));

The following examples will panic due to overflow:

use bnum::prelude::*;
use bnum::types::U256;
 
let _ = U256::MAX.strict_add(n!(1));
Source

pub const fn strict_sub(self, rhs: Self) -> Self

Strict integer addition. Computes self + rhs, panicking if overflow occurs.

§Panics

This function will panic if overflow occurs, regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(5U24).strict_sub(n!(2U24)), n!(3U24));
assert_eq!(n!(-5I24).strict_sub(n!(-2I24)), n!(-3I24));

The following example will panic due to overflow:

use bnum::prelude::*;
use bnum::types::I512;
 
let _ = I512::MIN.strict_sub(n!(1));
Source

pub const fn strict_mul(self, rhs: Self) -> Self

Strict integer addition. Computes self + rhs, panicking if overflow occurs.

§Panics

This function will panic if overflow occurs, regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(2U24).strict_mul(n!(3U24)), n!(6U24));
assert_eq!(n!(-2I24).strict_mul(n!(3I24)), n!(-6I24));

The following example will panic due to overflow:

use bnum::prelude::*;
use bnum::types::U1024;
 
let _ = U1024::MAX.strict_mul(n!(2));
Source

pub const fn strict_div(self, rhs: Self) -> Self

Strict integer addition. Computes self + rhs, panicking if overflow occurs.

§Panics

This function will panic if rhs is 0 or if overflow occurs, regardless of Self::OVERFLOW_MODE.

Overflow can only occur if the integers are signed, and self is Self::MIN and rhs is -1.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(9U24).strict_div(n!(4)), n!(2));
assert_eq!(n!(-9I24).strict_div(n!(4)), n!(-2));

The following example will panic due to overflow:

use bnum::prelude::*;
use bnum::types::I2048;
 
let _ = I2048::MIN.strict_div(n!(-1));

The following example will panic due to division by zero:

use bnum::prelude::*;
 
let _ = n!(10U2048).strict_div(n!(0));
Source

pub const fn strict_div_euclid(self, rhs: Self) -> Self

Strict integer addition. Computes self + rhs, panicking if overflow occurs.

§Panics

This function will panic if rhs is 0 or if overflow occurs, regardless of Self::OVERFLOW_MODE.

Overflow can only occur if the integers are signed, and self is Self::MIN and rhs is -1.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(9U24).strict_div_euclid(n!(4)), n!(2));
assert_eq!(n!(-9I24).strict_div_euclid(n!(4)), n!(-3));

The following example will panic due to overflow:

use bnum::prelude::*;
use bnum::types::I256;
 
let _ = I256::MIN.strict_div_euclid(n!(-1));

The following example will panic due to division by zero:

use bnum::prelude::*;
 
let _ = n!(10U256).strict_div_euclid(n!(0));
Source

pub const fn strict_rem(self, rhs: Self) -> Self

Strict integer remainder. Computes self % rhs, panicking if the division results in overflow.

§Panics

This function will panic if rhs is 0 or if overflow occurs in the division, regardless of Self::OVERFLOW_MODE.

Overflow can only occur if the integers are signed, and self is Self::MIN and rhs is -1.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(9U24).strict_rem(n!(4)), n!(1));
assert_eq!(n!(-9I24).strict_rem(n!(4)), n!(-1));

The following example will panic due to overflow:

use bnum::prelude::*;
use bnum::types::I512;
 
let _ = I512::MIN.strict_rem(n!(-1));

The following example will panic due to division by zero:

use bnum::prelude::*;
 
let _ = n!(10U512).strict_rem(n!(0));
Source

pub const fn strict_rem_euclid(self, rhs: Self) -> Self

Strict integer remainder. Computes self % rhs, panicking if the division results in overflow.

§Panics

This function will panic if rhs is 0 or if overflow occurs in the division, regardless of Self::OVERFLOW_MODE.

Overflow can only occur if the integers are signed, and self is Self::MIN and rhs is -1.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(9U24).strict_rem_euclid(n!(4)), n!(1));
assert_eq!(n!(-9I24).strict_rem_euclid(n!(4)), n!(3));

The following example will panic due to overflow:

use bnum::prelude::*;
use bnum::types::I1024;
 
let _ = I1024::MIN.strict_rem_euclid(n!(-1));

The following example will panic due to division by zero:

use bnum::prelude::*;
 
let _ = n!(10U1024).strict_rem_euclid(n!(0));
Source

pub const fn strict_neg(self) -> Self

Strict negation. Computes -self, panicking if overflow occurs.

§Panics

This function will panic if overflow occurs, regardless of Self::OVERFLOW_MODE.

For unsigned integers, overflow will occur unless self is 0. For signed integers, overflow will only occur if self is Self::MIN.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(0U24).strict_neg(), n!(0));
assert_eq!(n!(5I24).strict_neg(), n!(-5));

The following examples will panic due to overflow:

use bnum::prelude::*;
 
let _ = n!(1U256).strict_neg();
use bnum::types::I256;
 
let _ = I256::MIN.strict_neg();
Source

pub const fn strict_shl(self, rhs: u32) -> Self

Strict left shift. Computes self << rhs, panicking if rhs is greater than or equal to Self::BITS.

§Panics

This function will panic if rhs is greater than or equal to Self::BITS, regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(3U24).strict_shl(2), n!(12U24));
assert_eq!(n!(-3I24).strict_shl(2), n!(-12I24));

The following example will panic due to overflow:

use bnum::prelude::*;
 
let _ = n!(1U512).strict_shl(512);
Source

pub const fn strict_shr(self, rhs: u32) -> Self

Strict right shift. Computes self >> rhs, panicking if rhs is greater than or equal to Self::BITS.

§Panics

This function will panic if rhs is greater than or equal to Self::BITS, regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(17U24).strict_shr(2), n!(4U24));
assert_eq!(n!(-23I24).strict_shr(2), n!(-6I24));

The following example will panic due to overflow:

use bnum::types::I1024;
 
let _ = I1024::MAX.strict_shr(1024);
Source

pub const fn strict_pow(self, exp: u32) -> Self

Strict exponentiation. Computes self.pow(exp), panicking if overflow occurs.

§Panics

This function will panic if overflow occurs, regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(2U24).strict_pow(3), n!(8));
assert_eq!(n!(-3I24).strict_pow(5), n!(-243));

The following example will panic due to overflow:

use bnum::prelude::*;
 
let _ = n!(2U2048).strict_pow(2048);
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<false, N, B, OM>

(Unsigned integers only.) Strict arithmetic methods which act on self: self.strict_.... Each method will always panic if overflow or division by zero occurs (i.e. when the checked equivalent would return None), regardless of Self::OVERFLOW_MODE.

Source

pub const fn strict_add_signed(self, rhs: Int<N, B, OM>) -> Self

Strict addition with a signed integer of the same bit width. Computes self + rhs, panicking if overflow occurs.

§Panics

This function will panic if overflow occurs, regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(5U24).strict_add_signed(n!(-2I24)), n!(3U24));

The following example will panic due to overflow:

use bnum::prelude::*;
use bnum::types::U256;
 
let _ = U256::MIN.strict_add_signed(n!(-1I256));
Source

pub const fn strict_sub_signed(self, rhs: Int<N, B, OM>) -> Self

Strict subtraction by a signed integer of the same bit width. Computes self - rhs, panicking if overflow occurs.

§Panics

This function will panic if overflow occurs, regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(5U24).strict_sub_signed(n!(-2I24)), n!(7U24));

The following example will panic due to overflow:

use bnum::prelude::*;
use bnum::types::U256;
 
let _ = U256::MAX.strict_sub_signed(n!(-1I256));
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<true, N, B, OM>

(Signed integers only.) Strict arithmetic methods which act on self: self.strict_.... Each method will always panic if overflow or division by zero occurs (i.e. when the checked equivalent would return None), regardless of Self::OVERFLOW_MODE.

Source

pub const fn strict_abs(self) -> Self

Strict absolute value. Computes self.abs(), panicking if overflow occurs.

§Panics

This function will panic if overflow occurs (i.e. if self is Self::MIN), regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(-5I24).strict_abs(), n!(5I24));

The following example will panic due to overflow:

use bnum::types::I512;
 
let _ = I512::MIN.strict_abs();
Source

pub const fn strict_add_unsigned(self, rhs: Uint<N, B, OM>) -> Self

Strict addition with an unsigned integer of the same bit width. Computes self + rhs, panicking if overflow occurs.

§Panics

This function will panic if overflow occurs, regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(5I24).strict_add_unsigned(n!(2U24)), n!(7I24));

The following example will panic due to overflow:

use bnum::prelude::*;
use bnum::types::I1024;
 
let _ = I1024::MAX.strict_add_unsigned(n!(1U1024));
Source

pub const fn strict_sub_unsigned(self, rhs: Uint<N, B, OM>) -> Self

Strict subtraction by an unsigned integer of the same bit width. Computes self - rhs, panicking if overflow occurs.

§Panics

This function will panic if overflow occurs, regardless of Self::OVERFLOW_MODE.

§Examples
use bnum::prelude::*;
 
assert_eq!(n!(5I24).strict_sub_unsigned(n!(7U24)), n!(-2I24));

The following example will panic due to overflow:

use bnum::prelude::*;
use bnum::types::I2048;
 
let _ = I2048::MIN.strict_sub_unsigned(n!(1U2048));
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Unchecked arithmetic methods which act on self: self.unchecked_.... Each method results in undefined behavior if overflow occurs (i.e. when the checked equivalent would return None). These methods should therefore only be used when it can be guaranteed that overflow will not occur. If you want to avoid panicking in arithmetic in debug mode, use the wrapping equivalents instead.

Source

pub const unsafe fn unchecked_add(self, rhs: Self) -> Self

Unchecked integer addition. Computes self + rhs without checking for overflow, resulting in undefined behavior if overflow occurs.

a.unchecked_add(b) is equivalent to a.checked_add(b).unwrap_unchecked().

§Safety

This results in undefined behaviour if overflow occurs, i.e. when checked_add would return None.

Source

pub const unsafe fn unchecked_sub(self, rhs: Self) -> Self

Unchecked integer subtraction. Computes self - rhs without checking for overflow, resulting in undefined behavior if overflow occurs.

a.unchecked_sub(b) is equivalent to a.checked_sub(b).unwrap_unchecked().

§Safety

This results in undefined behaviour if overflow occurs, i.e. when checked_sub would return None.

Source

pub const unsafe fn unchecked_mul(self, rhs: Self) -> Self

Unchecked integer multiplication. Computes self * rhs without checking for overflow, resulting in undefined behavior if overflow occurs.

a.unchecked_mul(b) is equivalent to a.checked_mul(b).unwrap_unchecked().

§Safety

This results in undefined behaviour if overflow occurs, i.e. when checked_mul would return None.

Source

pub const unsafe fn unchecked_shl(self, rhs: u32) -> Self

Unchecked left shift. Computes self << rhs without checking for overflow, resulting in undefined behavior if overflow occurs.

a.unchecked_shl(b) is equivalent to a.checked_shl(b).unwrap_unchecked().

§Safety

This results in undefined behaviour if rhs is greater than or equal to Self::BITS, i.e. when checked_shl would return None.

Source

pub const unsafe fn unchecked_shr(self, rhs: u32) -> Self

Unchecked right shift. Computes self >> rhs without checking for overflow, resulting in undefined behavior if overflow occurs.

a.unchecked_shr(b) is equivalent to a.checked_shr(b).unwrap_unchecked().

§Safety

This results in undefined behaviour if rhs is greater than or equal to Self::BITS, i.e. when checked_shr would return None.

Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<true, N, B, OM>

(Signed integers only.) Unchecked arithmetic methods which act on self: self.unchecked_.... Each method results in undefined behavior if overflow occurs (i.e. when the checked equivalent would return None). These methods should therefore only be used when it can be guaranteed that overflow will not occur. If you want to avoid panicking in arithmetic in debug mode, use the wrapping equivalents instead.

Source

pub const unsafe fn unchecked_neg(self) -> Self

Unchecked integer negation. Computes -self without checking for overflow, resulting in undefined behavior if overflow occurs.

a.unchecked_neg() is equivalent to a.checked_neg().unwrap_unchecked().

§Safety

This results in undefined behaviour if overflow occurs, i.e. when checked_neg would return None. This can only occur if self is Self::MIN.

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Wrap arithmetic methods which act on self: self.wrapping_.... Each method returns of the calculation truncated to the number of bits of self (i.e. modulo Self::MAX + 1), except for the wrapping_shl and wrapping_shr methods, which return the value shifted by rhs % Self::BITS.

Source

pub const fn wrapping_add(self, rhs: Self) -> Self

Wrap integer addition. Computes self + rhs modulo Self::MAX + 1.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};
 
assert_eq!(n!(1U1024).wrapping_add(n!(1)), n!(2));
assert_eq!(U1024::MAX.wrapping_add(n!(1)), n!(0));
 
assert_eq!(I1024::MIN.wrapping_add(n!(-1)), I1024::MAX);
assert_eq!(I1024::MAX.wrapping_add(n!(1)), I1024::MIN);
Source

pub const fn wrapping_sub(self, rhs: Self) -> Self

Wrap integer subtraction. Computes self - rhs modulo Self::MAX + 1.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U256, I256};
 
assert_eq!(n!(1U256).wrapping_sub(n!(1)), n!(0));
assert_eq!(n!(0U256).wrapping_sub(n!(1)), U256::MAX);
 
assert_eq!(I256::MIN.wrapping_sub(n!(1)), I256::MAX);
assert_eq!(I256::MAX.wrapping_sub(n!(-1)), I256::MIN);
Source

pub const fn wrapping_mul(self, rhs: Self) -> Self

Wrap integer multiplication. Computes self * rhs modulo Self::MAX + 1.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U512, I512};
 
assert_eq!(n!(1U512).wrapping_mul(n!(1)), n!(1));
assert_eq!(U512::power_of_two(511).wrapping_mul(n!(2)), n!(0));
 
assert_eq!(I512::MIN.wrapping_mul(n!(-1)), I512::MIN);
assert_eq!(I512::MIN.wrapping_mul(I512::MIN), n!(0));
Source

pub const fn wrapping_div(self, rhs: Self) -> Self

Wrap integer division. Note that wrap around can only occur for signed integers, when self is Self::MIN and rhs is -1.

§Panics

This function will panic if rhs is zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};
 
assert_eq!(n!(5U1024).wrapping_div(n!(2)), n!(2));
 
assert_eq!(n!(-47I1024).wrapping_div(n!(-5)), n!(9));
assert_eq!(I1024::MIN.wrapping_div(n!(-1)), I1024::MIN);
Source

pub const fn wrapping_div_euclid(self, rhs: Self) -> Self

Wrap Euclidean division. Note that wrap around can only occur for signed integers, when self is Self::MIN and rhs is -1. In this case, the function returns Self::MIN.

§Panics

This function will panic if rhs is zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};
 
assert_eq!(n!(13U2048).wrapping_div_euclid(n!(5)), n!(2));
 
assert_eq!(n!(-13I2048).wrapping_div_euclid(n!(5)), n!(-3));
assert_eq!(I2048::MIN.wrapping_div_euclid(n!(-1)), I2048::MIN);
Source

pub const fn wrapping_rem(self, rhs: Self) -> Self

Wrap integer remainder. This is equivalent to self.strict_rem(rhs).

§Panics

This function will panic if rhs is zero.

§Examples
use bnum::prelude::*;
 
use bnum::types::I256;
 
assert_eq!(n!(13U256).wrapping_rem(n!(5)), n!(3));
assert_eq!(I256::MIN.wrapping_rem(n!(-1)), n!(0));
Source

pub const fn wrapping_rem_euclid(self, rhs: Self) -> Self

Wrap Euclidean remainder. This is equivalent to self.strict_rem_euclid(rhs).

§Panics

This function will panic if rhs is zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::I512;
 
assert_eq!(n!(13U512).wrapping_rem_euclid(n!(5)), n!(3));
assert_eq!(I512::MIN.wrapping_rem_euclid(n!(-1)), n!(0));
Source

pub const fn wrapping_neg(self) -> Self

Wrap (modular) negation. Computes -self modulo Self::MAX + 1.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};
 
assert_eq!(n!(1U1024).wrapping_neg(), U1024::MAX);
assert_eq!(U1024::MAX.wrapping_neg(), n!(1));
assert_eq!(n!(0U1024).wrapping_neg(), n!(0));
 
assert_eq!(n!(1I1024).wrapping_neg(), n!(-1));
assert_eq!(I1024::MIN.wrapping_neg(), I1024::MIN);
Source

pub const fn wrapping_shl(self, rhs: u32) -> Self

Panic-free left shift. Returns self << (rhs % Self::BITS).

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U2048, I2048};
 
assert_eq!(n!(1U2048).wrapping_shl(1), n!(2));
assert_eq!(n!(1U2048).wrapping_shl(2049), n!(2));
assert_eq!(n!(1U2048).wrapping_shl(2048), n!(1));
 
assert_eq!(n!(-2I2048).wrapping_shl(1), n!(-4));
assert_eq!(n!(-2I2048).wrapping_shl(2049), n!(-4));
assert_eq!(n!(-2I2048).wrapping_shl(2048), n!(-2));
Source

pub const fn wrapping_shr(self, rhs: u32) -> Self

Panic-free right shift. Returns self >> (rhs % Self::BITS).

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::{U1024, I1024};
 
assert_eq!(n!(1U1024).wrapping_shr(1), n!(0));
assert_eq!(n!(2U1024).wrapping_shr(1025), n!(1));
assert_eq!(U1024::MAX.wrapping_shr(1024), U1024::MAX);
assert_eq!(U1024::MAX.wrapping_shr(1023), n!(1));
 
assert_eq!(n!(-4I1024).wrapping_shr(1), n!(-2));
assert_eq!(I1024::MIN.wrapping_shr(2048), I1024::MIN);
assert_eq!(I1024::MIN.wrapping_shr(2047), n!(-1));
Source

pub const fn wrapping_pow(self, exp: u32) -> Self

Wrap exponentiation. Computes self.pow(exp) modulo Self::MAX + 1.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::I512;
 
assert_eq!(n!(2U512).wrapping_pow(10), n!(1024));
assert_eq!(n!(2U512).wrapping_pow(512), n!(0));
 
assert_eq!(n!(-2I512).wrapping_pow(512), n!(0));
assert_eq!(n!(2I512).wrapping_pow(511), I512::MIN);
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<false, N, B, OM>

(Unsigned integers only.) Wrap arithmetic methods which act on self: self.wrapping_.... Each method returns of the calculation truncated to the number of bits of self (i.e. modulo Self::MAX + 1), except for the wrapping_shl and wrapping_shr methods, which return the value shifted by rhs % Self::BITS.

Source

pub const fn wrapping_add_signed(self, rhs: Int<N, B, OM>) -> Self

Wrap integer addition with a signed integer of the same bit width. Computes self + rhs modulo Self::MAX + 1.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::U512;
 
assert_eq!(n!(1U512).wrapping_add_signed(n!(1)), n!(2));
assert_eq!(U512::MAX.wrapping_add_signed(n!(1)), n!(0));
assert_eq!(n!(1U512).wrapping_add_signed(n!(-2)), U512::MAX);
Source

pub const fn wrapping_sub_signed(self, rhs: Int<N, B, OM>) -> Self

Wrap integer subtraction with a signed integer of the same bit width. Computes self - rhs modulo Self::MAX + 1.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::U2048;
 
assert_eq!(n!(1U2048).wrapping_sub_signed(n!(-1)), n!(2));
assert_eq!(U2048::MAX.wrapping_sub_signed(n!(-1)), n!(0));
assert_eq!(n!(1U2048).wrapping_sub_signed(n!(2)), U2048::MAX);
Source

pub const fn wrapping_next_power_of_two(self) -> Self

Returns the smallest power of two greater than or equal to self. If the next power of two is greater than Self::MAX, the return value is wrapped to zero.

§Examples

Basic usage:

use bnum::prelude::*;
use bnum::types::U256;
 
assert_eq!(n!(4U256).wrapping_next_power_of_two(), n!(4));
assert_eq!(n!(31U256).wrapping_next_power_of_two(), n!(32));
assert_eq!(U256::MAX.wrapping_next_power_of_two(), n!(0));
Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<true, N, B, OM>

(Signed integers only.) Wrap arithmetic methods which act on self: self.wrapping_.... Each method returns of the calculation truncated to the number of bits of self (i.e. modulo Self::MAX + 1), except for the wrapping_shl and wrapping_shr methods, which return the value shifted by rhs % Self::BITS.

Source

pub const fn wrapping_add_unsigned(self, rhs: Uint<N, B, OM>) -> Self

Wrap integer addition with an unsigned integer of the same bit width. Computes self + rhs modulo Self::MAX + 1.

§Examples
use bnum::prelude::*;
use bnum::types::{U512, I512};
 
assert_eq!(I512::MIN.wrapping_add_unsigned(U512::MAX), I512::MAX);
assert_eq!(n!(0I512).wrapping_add_unsigned(U512::MAX), n!(-1));
Source

pub const fn wrapping_sub_unsigned(self, rhs: Uint<N, B, OM>) -> Self

Wrap integer subtraction with an unsigned integer of the same bit width. Computes self - rhs modulo Self::MAX + 1.

§Examples
use bnum::prelude::*;
use bnum::types::{U1024, I1024};
 
assert_eq!(I1024::MAX.wrapping_sub_unsigned(U1024::MAX), I1024::MIN);
assert_eq!(n!(0I1024).wrapping_sub_unsigned(U1024::MAX), n!(1));
Source

pub const fn wrapping_abs(self) -> Self

Wrap absolute value. Computes self.abs() modulo Self::MAX + 1. Note that overflow can only occur when self is Self::MIN, in which case the function returns Self::MIN.

§Examples
use bnum::prelude::*;
use bnum::types::I2048;
 
assert_eq!(n!(-123I2048).wrapping_abs(), n!(123));
assert_eq!(I2048::MIN.wrapping_abs(), I2048::MIN);
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer<S, N, B, OM>

Provides const function alternatives to methods of common traits, such as Add and BitOr. These functions will be removed once const traits are stabilized.

Source

pub const fn bitand(self, rhs: Self) -> Self

Source

pub const fn bitor(self, rhs: Self) -> Self

Source

pub const fn bitxor(self, rhs: Self) -> Self

Source

pub const fn not(self) -> Self

Source

pub const fn eq(&self, other: &Self) -> bool

Source

pub const fn ne(&self, other: &Self) -> bool

Source

pub const fn cmp(&self, other: &Self) -> Ordering

Source

pub const fn max(self, other: Self) -> Self

Source

pub const fn min(self, other: Self) -> Self

Source

pub const fn clamp(self, min: Self, max: Self) -> Self

Source

pub const fn lt(&self, other: &Self) -> bool

Source

pub const fn le(&self, other: &Self) -> bool

Source

pub const fn gt(&self, other: &Self) -> bool

Source

pub const fn ge(&self, other: &Self) -> bool

Source

pub const fn add(self, rhs: Self) -> Self

Source

pub const fn mul(self, rhs: Self) -> Self

Source

pub const fn shl(self, rhs: u32) -> Self

Source

pub const fn shr(self, rhs: u32) -> Self

Source

pub const fn sub(self, rhs: Self) -> Self

Source

pub const fn div(self, rhs: Self) -> Self

Source

pub const fn rem(self, rhs: Self) -> Self

Source§

impl<const N: usize, const B: usize, const OM: u8> Integer<true, N, B, OM>

Source

pub const fn neg(self) -> Self

Trait Implementations§

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Add<&Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Add<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Add<Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Add for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AddAssign<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

fn add_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the += operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AddAssign for Integer<S, N, B, OM>

Source§

fn add_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the += operation. Read more
Source§

impl<'arbitrary, const S: bool, const N: usize, const B: usize, const OM: u8> Arbitrary<'arbitrary> for Integer<S, N, B, OM>

Source§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
Source§

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
Source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Arbitrary for Integer<S, N, B, OM>

Available on crate features quickcheck only.
Source§

fn arbitrary(g: &mut Gen) -> Self

Return an arbitrary value. Read more
Source§

fn shrink(&self) -> Box<dyn Iterator<Item = Self>>

Return an iterator of values that are smaller than itself. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> AsPrimitive<Integer<R, M, A, OM>> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<R, M, A, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for bool

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for char

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for f32

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for f64

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for i128

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for i16

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for i32

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for i64

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for i8

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for isize

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for u128

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for u16

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for u32

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for u64

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for u8

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<Integer<S, N, B, OM>> for usize

Available on crate feature numtraits only.
Source§

fn as_(self) -> Integer<S, N, B, OM>

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<f32> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> f32

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<f64> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> f64

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<i128> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> i128

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<i16> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> i16

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<i32> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> i32

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<i64> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> i64

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<i8> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> i8

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<isize> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> isize

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<u128> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> u128

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<u16> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> u16

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<u32> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> u32

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<u64> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> u64

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<u8> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> u8

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> AsPrimitive<usize> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn as_(self) -> usize

Convert a value to another, using the as operator.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Binary for Integer<S, N, B, OM>

Available on crate feature alloc only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitAnd<&Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the & operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitAnd<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the & operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitAnd<Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the & operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitAnd for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self

Performs the & operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitAndAssign<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

fn bitand_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the &= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitAndAssign for Integer<S, N, B, OM>

Source§

fn bitand_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the &= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitOr<&Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the | operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitOr<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the | operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitOr<Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the | operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitOr for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitOrAssign<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

fn bitor_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the |= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitOrAssign for Integer<S, N, B, OM>

Source§

fn bitor_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the |= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitXor<&Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitXor<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitXor<Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitXor for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self

Performs the ^ operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitXorAssign<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

fn bitxor_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the ^= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BitXorAssign for Integer<S, N, B, OM>

Source§

fn bitxor_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the ^= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BorshDeserialize for Integer<S, N, B, OM>

Source§

fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>

Source§

fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
Source§

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
Source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BorshSchema for Integer<S, N, B, OM>

Source§

fn declaration() -> Declaration

Get the name of the type without brackets.
Source§

fn add_definitions_recursively( definitions: &mut BTreeMap<Declaration, Definition>, )

Recursively, using DFS, add type definitions required for this type. Type definition partially explains how to serialize/deserialize a type.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> BorshSerialize for Integer<S, N, B, OM>

Source§

fn serialize<__W: Write>(&self, writer: &mut __W) -> Result<(), Error>

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Bounded for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn min_value() -> Self

Returns the smallest finite number this type can represent
Source§

fn max_value() -> Self

Returns the largest finite number this type can represent
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> CastFrom<Integer<R, M, A, OM>> for Integer<S, N, B, OM>

Source§

fn cast_from(value: Integer<R, M, A, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for f32

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for f64

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for i128

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for i16

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for i32

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for i64

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for i8

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for isize

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for u128

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for u16

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for u32

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for u64

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for u8

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<Integer<S, N, B, OM>> for usize

Source§

fn cast_from(value: Integer<S, N, B, OM>) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<bool> for Integer<S, N, B, OM>

Source§

fn cast_from(value: bool) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<char> for Integer<S, N, B, OM>

Source§

fn cast_from(value: char) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<f32> for Integer<S, N, B, OM>

Source§

fn cast_from(value: f32) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<f64> for Integer<S, N, B, OM>

Source§

fn cast_from(value: f64) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<i128> for Integer<S, N, B, OM>

Source§

fn cast_from(value: i128) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<i16> for Integer<S, N, B, OM>

Source§

fn cast_from(value: i16) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<i32> for Integer<S, N, B, OM>

Source§

fn cast_from(value: i32) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<i64> for Integer<S, N, B, OM>

Source§

fn cast_from(value: i64) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<i8> for Integer<S, N, B, OM>

Source§

fn cast_from(value: i8) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<isize> for Integer<S, N, B, OM>

Source§

fn cast_from(value: isize) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<u128> for Integer<S, N, B, OM>

Source§

fn cast_from(value: u128) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<u16> for Integer<S, N, B, OM>

Source§

fn cast_from(value: u16) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<u32> for Integer<S, N, B, OM>

Source§

fn cast_from(value: u32) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<u64> for Integer<S, N, B, OM>

Source§

fn cast_from(value: u64) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<u8> for Integer<S, N, B, OM>

Source§

fn cast_from(value: u8) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CastFrom<usize> for Integer<S, N, B, OM>

Source§

fn cast_from(value: usize) -> Self

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CheckedAdd for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn checked_add(&self, rhs: &Self) -> Option<Self>

Adds two numbers, checking for overflow. If overflow happens, None is returned.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CheckedDiv for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn checked_div(&self, rhs: &Self) -> Option<Self>

Divides two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CheckedEuclid for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn checked_div_euclid(&self, rhs: &Self) -> Option<Self>

Performs euclid division that returns None instead of panicking on division by zero and instead of wrapping around on underflow and overflow.
Source§

fn checked_rem_euclid(&self, rhs: &Self) -> Option<Self>

Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned.
Source§

fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>

Returns both the quotient and remainder from checked Euclidean division. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CheckedMul for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn checked_mul(&self, rhs: &Self) -> Option<Self>

Multiplies two numbers, checking for underflow or overflow. If underflow or overflow happens, None is returned.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CheckedNeg for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn checked_neg(&self) -> Option<Self>

Negates a number, returning None for results that can’t be represented, like signed MIN values that can’t be positive, or non-zero unsigned values that can’t be negative. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CheckedRem for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn checked_rem(&self, rhs: &Self) -> Option<Self>

Finds the remainder of dividing two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CheckedShl for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn checked_shl(&self, rhs: u32) -> Option<Self>

Checked shift left. Computes self << rhs, returning None if rhs is larger than or equal to the number of bits in self. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CheckedShr for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn checked_shr(&self, rhs: u32) -> Option<Self>

Checked shift right. Computes self >> rhs, returning None if rhs is larger than or equal to the number of bits in self. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> CheckedSub for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn checked_sub(&self, rhs: &Self) -> Option<Self>

Subtracts two numbers, checking for underflow. If underflow happens, None is returned.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Clone for Integer<S, N, B, OM>

Source§

fn clone(&self) -> Integer<S, N, B, OM>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ConstOne for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

const ONE: Self = Self::ONE

The multiplicative identity element of Self, 1.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ConstZero for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

const ZERO: Self = Self::ZERO

The additive identity element of Self, 0.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Debug for Integer<S, N, B, OM>

Available on crate feature alloc only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Default for Integer<S, N, B, OM>

Source§

fn default() -> Self

Returns the default value of 0.

Source§

impl<'de, const S: bool, const N: usize, const B: usize, const OM: u8> Deserialize<'de> for Integer<S, N, B, OM>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Display for Integer<S, N, B, OM>

Available on crate feature alloc only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Distribution<Integer<S, N, B, OM>> for StandardUniform

Available on crate feature rand only.
Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Integer<S, N, B, OM>

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> Map<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Map sampled values to type S Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Div<&Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Div<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Div<Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Div for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self

Performs the / operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> DivAssign<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

fn div_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the /= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> DivAssign for Integer<S, N, B, OM>

Source§

fn div_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the /= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Euclid for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn div_euclid(&self, rhs: &Self) -> Self

Calculates Euclidean division, the matching method for rem_euclid. Read more
Source§

fn rem_euclid(&self, rhs: &Self) -> Self

Calculates the least nonnegative remainder of self (mod v). Read more
Source§

fn div_rem_euclid(&self, v: &Self) -> (Self, Self)

Returns both the quotient and remainder from Euclidean division. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Fill for Integer<S, N, B, OM>

Available on crate feature rand only.
Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Fill this with random data
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> From<bool> for Integer<S, N, B, OM>

Source§

fn from(small: bool) -> Self

Converts to this type from the input type.
Source§

impl<const S: bool, const N: usize, const OM: u8> FromBytes for Integer<S, N, 0, OM>

Available on crate feature numtraits only.
Source§

type Bytes = [u8; N]

Source§

fn from_be_bytes(bytes: &[u8; N]) -> Self

Create a number from its representation as a byte array in big endian. Read more
Source§

fn from_le_bytes(bytes: &[u8; N]) -> Self

Create a number from its representation as a byte array in little endian. Read more
Source§

fn from_ne_bytes(bytes: &Self::Bytes) -> Self

Create a number from its memory representation as a byte array in native endianness. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> FromPrimitive for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn from_u8(n: u8) -> Option<Self>

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u16(n: u16) -> Option<Self>

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u32(n: u32) -> Option<Self>

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u64(n: u64) -> Option<Self>

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u128(n: u128) -> Option<Self>

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_usize(n: usize) -> Option<Self>

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i8(n: i8) -> Option<Self>

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i16(n: i16) -> Option<Self>

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i32(n: i32) -> Option<Self>

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i64(n: i64) -> Option<Self>

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i128(n: i128) -> Option<Self>

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_isize(n: isize) -> Option<Self>

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f32(f: f32) -> Option<Self>

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f64(f: f64) -> Option<Self>

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> FromStr for Integer<S, N, B, OM>

Source§

type Err = ParseIntError

The associated error which can be returned from parsing.
Source§

fn from_str(src: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Hash for Integer<S, N, B, OM>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Integer for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn div_floor(&self, other: &Self) -> Self

Floored integer division. Read more
Source§

fn mod_floor(&self, other: &Self) -> Self

Floored integer modulo, satisfying: Read more
Source§

fn gcd(&self, other: &Self) -> Self

Greatest Common Divisor (GCD). Read more
Source§

fn lcm(&self, other: &Self) -> Self

Lowest Common Multiple (LCM). Read more
Source§

fn divides(&self, other: &Self) -> bool

👎Deprecated:

Please use is_multiple_of instead

Deprecated, use is_multiple_of instead.
Source§

fn is_multiple_of(&self, other: &Self) -> bool

Returns true if self is a multiple of other. Read more
Source§

fn is_even(&self) -> bool

Returns true if the number is even. Read more
Source§

fn is_odd(&self) -> bool

Returns true if the number is odd. Read more
Source§

fn div_rem(&self, rhs: &Self) -> (Self, Self)

Simultaneous truncated integer division and modulus. Returns (quotient, remainder). Read more
Source§

fn div_ceil(&self, other: &Self) -> Self

Ceiled integer division. Read more
Source§

fn gcd_lcm(&self, other: &Self) -> (Self, Self)

Greatest Common Divisor (GCD) and Lowest Common Multiple (LCM) together. Read more
Source§

fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>
where Self: Clone,

Greatest common divisor and Bézout coefficients. Read more
Source§

fn extended_gcd_lcm(&self, other: &Self) -> (ExtendedGcd<Self>, Self)
where Self: Clone + Signed,

Greatest common divisor, least common multiple, and Bézout coefficients.
Source§

fn div_mod_floor(&self, other: &Self) -> (Self, Self)

Simultaneous floored integer division and modulus. Returns (quotient, remainder). Read more
Source§

fn next_multiple_of(&self, other: &Self) -> Self
where Self: Clone,

Rounds up to nearest multiple of argument. Read more
Source§

fn prev_multiple_of(&self, other: &Self) -> Self
where Self: Clone,

Rounds down to nearest multiple of argument. Read more
Source§

fn dec(&mut self)
where Self: Clone,

Decrements self by one. Read more
Source§

fn inc(&mut self)
where Self: Clone,

Increments self by one. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> LowerExp for Integer<S, N, B, OM>

Available on crate feature alloc only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> LowerHex for Integer<S, N, B, OM>

Available on crate feature alloc only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Mul<&Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Mul<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Mul<Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Mul for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> MulAdd for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the fused multiply-add.
Source§

fn mul_add(self, a: Self, b: Self) -> Self

Performs the fused multiply-add operation (self * a) + b
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> MulAddAssign for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn mul_add_assign(&mut self, a: Self, b: Self)

Performs the fused multiply-add assignment operation *self = (*self * a) + b
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> MulAssign<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

fn mul_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the *= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> MulAssign for Integer<S, N, B, OM>

Source§

fn mul_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the *= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Not for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Integer<S, N, B, OM>

Performs the unary ! operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Not for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self

Performs the unary ! operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Num for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

type FromStrRadixErr = ParseIntError

Source§

fn from_str_radix( string: &str, radix: u32, ) -> Result<Self, Self::FromStrRadixErr>

Convert from a string and radix (typically 2..=36). Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> NumCast for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn from<T: ToPrimitive>(_n: T) -> Option<Self>

Creates a number from another value that can be converted into a primitive via the ToPrimitive trait. If the source value cannot be represented by the target type, then None is returned. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Octal for Integer<S, N, B, OM>

Available on crate feature alloc only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> One for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn is_one(&self) -> bool

Returns true if self is equal to the multiplicative identity. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Ord for Integer<S, N, B, OM>

Source§

fn cmp(&self, other: &Self) -> Ordering

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

fn max(self, other: Self) -> Self

Compares and returns the maximum of two values. Read more
Source§

fn min(self, other: Self) -> Self

Compares and returns the minimum of two values. Read more
Source§

fn clamp(self, min: Self, max: Self) -> Self

Restrict a value to a certain interval. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> OverflowingAdd for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn overflowing_add(&self, rhs: &Self) -> (Self, bool)

Returns a tuple of the sum along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> OverflowingMul for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn overflowing_mul(&self, rhs: &Self) -> (Self, bool)

Returns a tuple of the product along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> OverflowingSub for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn overflowing_sub(&self, rhs: &Self) -> (Self, bool)

Returns a tuple of the difference along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> PartialEq for Integer<S, N, B, OM>

Source§

fn eq(&self, other: &Integer<S, N, B, OM>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> PartialOrd for Integer<S, N, B, OM>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Pow<u32> for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

type Output = Integer<S, N, B, OM>

The result after applying the operator.
Source§

fn pow(self, exp: u32) -> Self

Returns self to the power rhs. Read more
Source§

impl<const S: bool, const N: usize, const OM: u8> PrimInt for Integer<S, N, 0, OM>

Available on crate feature numtraits only.
Source§

fn from_be(x: Self) -> Self

Convert an integer from big endian to the target’s endianness. Read more
Source§

fn from_le(x: Self) -> Self

Convert an integer from little endian to the target’s endianness. Read more
Source§

fn to_be(self) -> Self

Convert self to big endian from the target’s endianness. Read more
Source§

fn to_le(self) -> Self

Convert self to little endian from the target’s endianness. Read more
Source§

fn count_ones(self) -> u32

Returns the number of ones in the binary representation of self. Read more
Source§

fn count_zeros(self) -> u32

Returns the number of zeros in the binary representation of self. Read more
Source§

fn leading_zeros(self) -> u32

Returns the number of leading zeros in the binary representation of self. Read more
Source§

fn trailing_zeros(self) -> u32

Returns the number of trailing zeros in the binary representation of self. Read more
Source§

fn rotate_left(self, n: u32) -> Self

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

fn rotate_right(self, n: u32) -> Self

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

fn swap_bytes(self) -> Self

Reverses the byte order of the integer. Read more
Source§

fn pow(self, exp: u32) -> Self

Raises self to the power of exp, using exponentiation by squaring. Read more
Source§

fn leading_ones(self) -> u32

Returns the number of leading ones in the binary representation of self. Read more
Source§

fn trailing_ones(self) -> u32

Returns the number of trailing ones in the binary representation of self. Read more
Source§

fn reverse_bits(self) -> Self

Reverses the order of bits in the integer. Read more
Source§

fn signed_shl(self, n: u32) -> Self

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

fn signed_shr(self, n: u32) -> Self

Shifts the bits to the right by a specified amount, n, copying the “sign bit” in the most significant bits even for unsigned types. Read more
Source§

fn unsigned_shl(self, n: u32) -> Self

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

fn unsigned_shr(self, n: u32) -> Self

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

impl<'a, const S: bool, const N: usize, const B: usize, const OM: u8> Product<&'a Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

fn product<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Product for Integer<S, N, B, OM>

Source§

fn product<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Rem<&Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Rem<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Rem<Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Rem for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self

Performs the % operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> RemAssign<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

fn rem_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the %= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> RemAssign for Integer<S, N, B, OM>

Source§

fn rem_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the %= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Roots for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn sqrt(&self) -> Self

Returns the truncated principal square root of an integer – ⌊√x⌋ Read more
Source§

fn cbrt(&self) -> Self

Returns the truncated principal cube root of an integer – if x >= 0 { ⌊∛x⌋ } else { ⌈∛x⌉ } Read more
Source§

fn nth_root(&self, n: u32) -> Self

Returns the truncated principal nth root of an integer – if x >= 0 { ⌊ⁿ√x⌋ } else { ⌈ⁿ√x⌉ } Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> SampleUniform for Integer<S, N, B, OM>

Available on crate feature rand only.
Source§

type Sampler = UniformInt<Integer<S, N, B, OM>>

The UniformSampler implementation supporting type X.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Saturating for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn saturating_add(self, rhs: Self) -> Self

Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing.
Source§

fn saturating_sub(self, rhs: Self) -> Self

Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> SaturatingAdd for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn saturating_add(&self, rhs: &Self) -> Self

Saturating addition. Computes self + other, saturating at the relevant high or low boundary of the type.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> SaturatingMul for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn saturating_mul(&self, rhs: &Self) -> Self

Saturating multiplication. Computes self * other, saturating at the relevant high or low boundary of the type.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> SaturatingSub for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn saturating_sub(&self, rhs: &Self) -> Self

Saturating subtraction. Computes self - other, saturating at the relevant high or low boundary of the type.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Serialize for Integer<S, N, B, OM>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> Shl<&Integer<R, M, A, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<R, M, A, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> Shl<&Integer<R, M, A, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<R, M, A, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &i128

Source§

type Output = i128

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &i16

Source§

type Output = i16

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &i32

Source§

type Output = i32

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &i64

Source§

type Output = i64

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &i8

Source§

type Output = i8

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &isize

Source§

type Output = isize

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &u128

Source§

type Output = u128

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &u16

Source§

type Output = u16

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &u32

Source§

type Output = u32

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &u64

Source§

type Output = u64

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &u8

Source§

type Output = u8

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for &usize

Source§

type Output = usize

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for i128

Source§

type Output = i128

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for i16

Source§

type Output = i16

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for i32

Source§

type Output = i32

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for i64

Source§

type Output = i64

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for i8

Source§

type Output = i8

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for isize

Source§

type Output = isize

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for u128

Source§

type Output = u128

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for u16

Source§

type Output = u16

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for u32

Source§

type Output = u32

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for u64

Source§

type Output = u64

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for u8

Source§

type Output = u8

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&Integer<S, N, B, OM>> for usize

Source§

type Output = usize

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&i128> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&i128> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&i16> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&i16> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&i32> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&i32> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&i64> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&i64> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&i8> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&i8> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&isize> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &isize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&isize> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &isize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&u128> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&u128> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&u16> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&u16> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&u32> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&u32> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&u64> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&u64> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&u8> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&u8> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&usize> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &usize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<&usize> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &usize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> Shl<Integer<R, M, A, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<R, M, A, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> Shl<Integer<R, M, A, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<R, M, A, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &i128

Source§

type Output = i128

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &i16

Source§

type Output = i16

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &i32

Source§

type Output = i32

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &i64

Source§

type Output = i64

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &i8

Source§

type Output = i8

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &isize

Source§

type Output = isize

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &u128

Source§

type Output = u128

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &u16

Source§

type Output = u16

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &u32

Source§

type Output = u32

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &u64

Source§

type Output = u64

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &u8

Source§

type Output = u8

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for &usize

Source§

type Output = usize

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for i128

Source§

type Output = i128

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for i16

Source§

type Output = i16

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for i32

Source§

type Output = i32

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for i64

Source§

type Output = i64

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for i8

Source§

type Output = i8

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for isize

Source§

type Output = isize

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for u128

Source§

type Output = u128

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for u16

Source§

type Output = u16

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for u32

Source§

type Output = u32

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for u64

Source§

type Output = u64

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for u8

Source§

type Output = u8

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<Integer<S, N, B, OM>> for usize

Source§

type Output = usize

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<i128> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<i128> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i128) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<i16> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<i16> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i16) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<i32> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<i32> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<i64> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<i64> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i64) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<i8> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<i8> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i8) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<isize> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: isize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<isize> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: isize) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<u128> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<u128> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u128) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<u16> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<u16> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u16) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<u32> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<u32> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u32) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<u64> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<u64> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u64) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<u8> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<u8> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u8) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<usize> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: usize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shl<usize> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: usize) -> Self

Performs the << operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> ShlAssign<&Integer<R, M, A, OM>> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &Integer<R, M, A, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for i128

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for i16

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for i32

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for i64

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for i8

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for isize

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for u128

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for u16

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for u32

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for u64

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for u8

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&Integer<S, N, B, OM>> for usize

Source§

fn shl_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&i128> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &i128)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&i16> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &i16)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&i32> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &i32)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&i64> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &i64)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&i8> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &i8)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&isize> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &isize)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&u128> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &u128)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&u16> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &u16)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&u32> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &u32)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&u64> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &u64)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&u8> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &u8)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<&usize> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: &usize)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> ShlAssign<Integer<R, M, A, OM>> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: Integer<R, M, A, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for i128

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for i16

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for i32

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for i64

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for i8

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for isize

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for u128

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for u16

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for u32

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for u64

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for u8

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<Integer<S, N, B, OM>> for usize

Source§

fn shl_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<i128> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: i128)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<i16> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: i16)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<i32> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: i32)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<i64> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: i64)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<i8> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: i8)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<isize> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: isize)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<u128> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: u128)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<u16> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: u16)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<u32> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: u32)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<u64> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: u64)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<u8> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: u8)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShlAssign<usize> for Integer<S, N, B, OM>

Source§

fn shl_assign(&mut self, rhs: usize)

Performs the <<= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> Shr<&Integer<R, M, A, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<R, M, A, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> Shr<&Integer<R, M, A, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<R, M, A, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &i128

Source§

type Output = i128

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &i16

Source§

type Output = i16

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &i32

Source§

type Output = i32

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &i64

Source§

type Output = i64

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &i8

Source§

type Output = i8

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &isize

Source§

type Output = isize

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &u128

Source§

type Output = u128

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &u16

Source§

type Output = u16

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &u32

Source§

type Output = u32

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &u64

Source§

type Output = u64

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &u8

Source§

type Output = u8

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for &usize

Source§

type Output = usize

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for i128

Source§

type Output = i128

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for i16

Source§

type Output = i16

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for i32

Source§

type Output = i32

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for i64

Source§

type Output = i64

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for i8

Source§

type Output = i8

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for isize

Source§

type Output = isize

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for u128

Source§

type Output = u128

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for u16

Source§

type Output = u16

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for u32

Source§

type Output = u32

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for u64

Source§

type Output = u64

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for u8

Source§

type Output = u8

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&Integer<S, N, B, OM>> for usize

Source§

type Output = usize

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&i128> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&i128> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&i16> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&i16> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&i32> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&i32> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&i64> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&i64> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&i8> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&i8> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&isize> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&isize> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&u128> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&u128> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&u16> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&u16> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&u32> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&u32> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&u64> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&u64> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&u8> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&u8> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&usize> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<&usize> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> Shr<Integer<R, M, A, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<R, M, A, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> Shr<Integer<R, M, A, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<R, M, A, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &i128

Source§

type Output = i128

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &i16

Source§

type Output = i16

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &i32

Source§

type Output = i32

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &i64

Source§

type Output = i64

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &i8

Source§

type Output = i8

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &isize

Source§

type Output = isize

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &u128

Source§

type Output = u128

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &u16

Source§

type Output = u16

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &u32

Source§

type Output = u32

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &u64

Source§

type Output = u64

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &u8

Source§

type Output = u8

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for &usize

Source§

type Output = usize

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for i128

Source§

type Output = i128

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for i16

Source§

type Output = i16

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for i32

Source§

type Output = i32

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for i64

Source§

type Output = i64

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for i8

Source§

type Output = i8

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for isize

Source§

type Output = isize

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for u128

Source§

type Output = u128

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for u16

Source§

type Output = u16

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for u32

Source§

type Output = u32

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for u64

Source§

type Output = u64

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for u8

Source§

type Output = u8

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<Integer<S, N, B, OM>> for usize

Source§

type Output = usize

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Integer<S, N, B, OM>) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<i128> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<i128> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i128) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<i16> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<i16> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i16) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<i32> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<i32> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<i64> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<i64> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i64) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<i8> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<i8> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i8) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<isize> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<isize> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: isize) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<u128> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<u128> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u128) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<u16> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<u16> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u16) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<u32> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<u32> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u32) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<u64> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<u64> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u64) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<u8> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<u8> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u8) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<usize> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Shr<usize> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: usize) -> Self

Performs the >> operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> ShrAssign<&Integer<R, M, A, OM>> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &Integer<R, M, A, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for i128

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for i16

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for i32

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for i64

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for i8

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for isize

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for u128

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for u16

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for u32

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for u64

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for u8

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&Integer<S, N, B, OM>> for usize

Source§

fn shr_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&i128> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &i128)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&i16> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &i16)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&i32> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &i32)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&i64> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &i64)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&i8> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &i8)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&isize> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &isize)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&u128> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &u128)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&u16> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &u16)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&u32> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &u32)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&u64> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &u64)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&u8> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &u8)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<&usize> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: &usize)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> ShrAssign<Integer<R, M, A, OM>> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: Integer<R, M, A, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for i128

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for i16

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for i32

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for i64

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for i8

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for isize

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for u128

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for u16

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for u32

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for u64

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for u8

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<Integer<S, N, B, OM>> for usize

Source§

fn shr_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<i128> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: i128)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<i16> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: i16)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<i32> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: i32)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<i64> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: i64)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<i8> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: i8)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<isize> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: isize)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<u128> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: u128)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<u16> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: u16)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<u32> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: u32)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<u64> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: u64)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<u8> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: u8)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ShrAssign<usize> for Integer<S, N, B, OM>

Source§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Structable for Integer<S, N, B, OM>

Source§

fn definition(&self) -> StructDef<'_>

Returns the struct’s definition. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Sub<&Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Sub<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Integer<S, N, B, OM>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Sub<Integer<S, N, B, OM>> for &Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Integer<S, N, B, OM>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Sub for Integer<S, N, B, OM>

Source§

type Output = Integer<S, N, B, OM>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> SubAssign<&Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

fn sub_assign(&mut self, rhs: &Integer<S, N, B, OM>)

Performs the -= operation. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> SubAssign for Integer<S, N, B, OM>

Source§

fn sub_assign(&mut self, rhs: Integer<S, N, B, OM>)

Performs the -= operation. Read more
Source§

impl<'a, const S: bool, const N: usize, const B: usize, const OM: u8> Sum<&'a Integer<S, N, B, OM>> for Integer<S, N, B, OM>

Source§

fn sum<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Sum for Integer<S, N, B, OM>

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<const S: bool, const N: usize, const OM: u8> ToBytes for Integer<S, N, 0, OM>

Available on crate feature numtraits only.
Source§

type Bytes = [u8; N]

Source§

fn to_be_bytes(&self) -> [u8; N]

Return the memory representation of this number as a byte array in big-endian byte order. Read more
Source§

fn to_le_bytes(&self) -> [u8; N]

Return the memory representation of this number as a byte array in little-endian byte order. Read more
Source§

fn to_ne_bytes(&self) -> Self::Bytes

Return the memory representation of this number as a byte array in native byte order. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> ToPrimitive for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const R: bool, const M: usize, const A: usize, const OM: u8> TryFrom<&Integer<R, M, A, OM>> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Integer<R, M, A, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for i128

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for i16

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for i32

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for i64

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for i8

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for isize

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for u128

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for u16

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for u32

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for u64

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for u8

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<Integer<S, N, B, OM>> for usize

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Integer<S, N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize, const B: usize, const M: usize, const A: usize, const OM: u8> TryFrom<Integer<false, N, B, OM>> for Int<M, A, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Uint<N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize, const B: usize, const M: usize, const A: usize, const OM: u8> TryFrom<Integer<true, N, B, OM>> for Uint<M, A, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Int<N, B, OM>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<i128> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: i128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<i16> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: i16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<i32> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: i32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<i64> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: i64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<i8> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: i8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<isize> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: isize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<u128> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: u128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<u16> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: u16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<u32> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: u32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<u64> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: u64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<u8> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> TryFrom<usize> for Integer<S, N, B, OM>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(value: usize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> UpperExp for Integer<S, N, B, OM>

Available on crate feature alloc only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> UpperHex for Integer<S, N, B, OM>

Available on crate feature alloc only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Valuable for Integer<S, N, B, OM>

Source§

fn as_value(&self) -> Value<'_>

Converts self into a Value instance. Read more
Source§

fn visit(&self, visitor: &mut dyn Visit)

Calls the relevant method on Visit to extract data from self. Read more
Source§

fn visit_slice(slice: &[Self], visit: &mut dyn Visit)
where Self: Sized,

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> WrappingAdd for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn wrapping_add(&self, rhs: &Self) -> Self

Wrapping (modular) addition. Computes self + other, wrapping around at the boundary of the type.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> WrappingMul for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn wrapping_mul(&self, rhs: &Self) -> Self

Wrapping (modular) multiplication. Computes self * other, wrapping around at the boundary of the type.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> WrappingNeg for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn wrapping_neg(&self) -> Self

Wrapping (modular) negation. Computes -self, wrapping around at the boundary of the type. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> WrappingShl for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn wrapping_shl(&self, rhs: u32) -> Self

Panic-free bitwise shift-left; yields self << mask(rhs), where mask removes any high order bits of rhs that would cause the shift to exceed the bitwidth of the type. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> WrappingShr for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn wrapping_shr(&self, rhs: u32) -> Self

Panic-free bitwise shift-right; yields self >> mask(rhs), where mask removes any high order bits of rhs that would cause the shift to exceed the bitwidth of the type. Read more
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> WrappingSub for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn wrapping_sub(&self, rhs: &Self) -> Self

Wrapping (modular) subtraction. Computes self - other, wrapping around at the boundary of the type.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Zero for Integer<S, N, B, OM>

Available on crate feature numtraits only.
Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Copy for Integer<S, N, B, OM>

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> DefaultIsZeroes for Integer<S, N, B, OM>

Available on crate feature zeroize only.
Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Eq for Integer<S, N, B, OM>

Source§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> StructuralPartialEq for Integer<S, N, B, OM>

Auto Trait Implementations§

§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Freeze for Integer<S, N, B, OM>

§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> RefUnwindSafe for Integer<S, N, B, OM>

§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Send for Integer<S, N, B, OM>

§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Sync for Integer<S, N, B, OM>

§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> Unpin for Integer<S, N, B, OM>

§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> UnsafeUnpin for Integer<S, N, B, OM>

§

impl<const S: bool, const N: usize, const B: usize, const OM: u8> UnwindSafe for Integer<S, N, B, OM>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<I> Average for I
where &'a I: for<'a, 'b> BitAnd<&'b I, Output = I> + for<'a, 'b> BitOr<&'b I, Output = I> + for<'a, 'b> BitXor<&'b I, Output = I>, I: Integer + Shr<usize, Output = I>,

Source§

fn average_floor(&self, other: &I) -> I

Returns the floor value of the average of self and other.

Source§

fn average_ceil(&self, other: &I) -> I

Returns the ceil value of the average of self and other.

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LowerBounded for T
where T: Bounded,

Source§

fn min_value() -> T

Returns the smallest finite number this type can represent
Source§

impl<Borrowed> SampleBorrow<Borrowed> for Borrowed
where Borrowed: SampleUniform,

Source§

fn borrow(&self) -> &Borrowed

Immutably borrows from an owned value. See Borrow::borrow
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UpperBounded for T
where T: Bounded,

Source§

fn max_value() -> T

Returns the largest finite number this type can represent
Source§

impl<Z> Zeroize for Z
where Z: DefaultIsZeroes,

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> NumAssign for T
where T: Num + NumAssignOps,

Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T> NumAssignRef for T
where T: NumAssign + for<'r> NumAssignOps<&'r T>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

Source§

impl<T> NumRef for T
where T: Num + for<'r> NumOps<&'r T>,

Source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,