arbi

Struct Arbi

Source
pub struct Arbi { /* private fields */ }
Expand description

Arbitrary Precision Integer type.

§Internal Representation

The internal representation of an Arbi integer consists of a boolean field encoding whether or not the integer is negative, as well as a Vec of Digits (an unsigned integer type) encoding the absolute value of the integer with least significant digits first. A “digit” is a base-Arbi::BASE digit (i.e. an integer in \( [0, \text{Arbi::BASE} - 1] = [0, \text{Digit::MAX}] \)).

§Limits

  • Arbi::MAX_CAPACITY: Vec is limited to isize::MAX bytes in capacity. A digit has size in bytes core::mem::size_of::<Digit>(). The maximum capacity is therefore isize::MAX / core::mem::size_of::<Digit>().
  • Arbi::MAX_BITS: At maximum capacity, Arbi::MAX_BITS bits are available to represent the absolute value of the Arbi integer.

When resizing/reserving more space, if the needed space exceeds isize::MAX in bytes, the Vec allocation methods currently used will panic to signal capacity overflow. The Vec allocation methods also panic if the allocator reports allocation failure. In practice, memory allocation typically fails for less than isize::MAX in bytes.

In the future, we may choose to explicitly handle such errors to avoid a panic, where it makes sense.

§Panic

In general:

  • If an operation can panic, it will be clearly documented.

  • Operations typically only panic because they are enforcing consistency with the behavior of primitive integer types. For example, a division by zero panics. Similarly, Arbi::from_str_radix() and Arbi::to_string_radix() panic if the radix argument value is invalid, consistent with the built-in analogues. Arbi::from_str_base() and Arbi::to_string_base() are equivalent, except that they do not panic on invalid bases.

  • Because Vec is limited to isize::MAX bytes in capacity, if an operation would lead to an Arbi requiring more than isize::MAX bytes in capacity, then the current Vec allocation methods used will panic. The Vec allocation methods also panic if the allocator reports allocation failure. In practice, memory allocation typically fails for less than isize::MAX in bytes.

  • Some operations, such as exponentiation, might know in advance that the result will need a capacity that will exceed Vec’s limits. In such cases, the program will panic immediately, rather than allow it to run a long computation that is guaranteed to exhaust memory.

Implementations§

Source§

impl Arbi

Source

pub fn assign_str_radix( &mut self, s: &str, radix: u32, ) -> Result<(), ParseError>

Assign the integer value the provided string represents to this Arbi integer.

§Panic

Panics if radix is not in \( [2, 36] \). Use Arbi::assign_str_base for a panic-free version.

§Examples
use arbi::{Arbi, ParseError};

let mut x = Arbi::with_capacity(10);
assert_eq!(x, 0);

match x.assign_str_radix("123456789", 10) {
    Ok(_) => assert_eq!(x, 123456789),
    Err(e) => match e {
        ParseError::InvalidDigit => panic!("Found an invalid digit"),
        ParseError::Empty => panic!("Found an empty string"),
    },
}

if let Err(e) = x.assign_str_radix("7c2ecdfacad74e0f0101b", 16) {
    panic!("Parsing error: {}", e);
}
assert_eq!(x, 0x7c2ecdfacad74e0f0101b_u128);

The Arbi integer will remain in its original state if a parsing error occurs:

use arbi::{Arbi, Assign, ParseError};

let mut x = Arbi::from(u128::MAX);
assert_eq!(x, u128::MAX);

match x.assign_str_radix("7c2ecdfacad74e0f0101b", 15) {
    Ok(_) => panic!(),
    Err(e) => {
        assert!(matches!(e, ParseError::InvalidDigit));
        assert_eq!(x, u128::MAX);
    }
}

Panics on invalid radix values

use arbi::Arbi;

let mut x = Arbi::with_capacity(5);
x.assign_str_radix("7c2ecdfacad74e0f0101b", 37);

Example invalid strings

use arbi::{Arbi, ParseError};

let mut a = Arbi::zero();

assert!(matches!(
    a.assign_str_radix("   - ", 10),
    Err(ParseError::Empty)
));
assert!(matches!(
    a.assign_str_radix("ffff", 10),
    Err(ParseError::InvalidDigit)
));
Source

pub fn assign_str_base(&mut self, s: &str, base: Base) -> Result<(), ParseError>

Assign the integer value the provided string represents to this Arbi integer.

§Examples
use arbi::{
    base::{DEC, HEX},
    Arbi, ParseError,
};

let mut x = Arbi::with_capacity(10);
assert_eq!(x, 0);

match x.assign_str_base("123456789", DEC) {
    Ok(_) => assert_eq!(x, 123456789),
    Err(e) => match e {
        ParseError::InvalidDigit => panic!("Found an invalid digit"),
        ParseError::Empty => panic!("Found an empty string"),
    },
}

if let Err(e) = x.assign_str_base("7c2ecdfacad74e0f0101b", HEX) {
    panic!("Parsing error: {}", e);
}
assert_eq!(x, 0x7c2ecdfacad74e0f0101b_u128);

The Arbi integer will remain in its original state if a parsing error occurs:

use arbi::{Arbi, Base, ParseError};

let mut x = Arbi::from(u128::MAX);
assert_eq!(x, u128::MAX);

match x
    .assign_str_base("7c2ecdfacad74e0f0101b", Base::try_from(15).unwrap())
{
    Ok(_) => panic!(),
    Err(e) => {
        assert!(matches!(e, ParseError::InvalidDigit));
        assert_eq!(x, u128::MAX);
    }
}

Example invalid strings:

use arbi::{base::DEC, Arbi, ParseError};

let mut a = Arbi::zero();

assert!(matches!(
    a.assign_str_base("   - ", DEC),
    Err(ParseError::Empty)
));
assert!(matches!(
    a.assign_str_base("ffff", DEC),
    Err(ParseError::InvalidDigit)
));
Source§

impl Arbi

Source

pub fn test_bit(&self, i: BitCount) -> bool

Test bit i (zero-based indexing) of the absolute value of this integer.

§Examples
use arbi::Arbi;

// 11000000111001 (bit indices [0, 13])
let a = Arbi::from(12345);
assert_eq!(a.test_bit(0), true);
assert_eq!(a.test_bit(1), false);
assert_eq!(a.test_bit(5), true);
assert_eq!(a.test_bit(13), true);

// 14 is not in [0, size_bits()). Bits outside of this range are
// treated as false.
assert_eq!(a.test_bit(14), false);
§Complexity

\( O(1) \)

Source

pub fn set_bit(&mut self, i: BitCount) -> &mut Self

Set bit i (zero-based indexing) of the absolute value of this integer, leaving its sign unchanged.

§Examples
use arbi::Arbi;

// 11000000111001
let mut a = Arbi::from(12345);

a.set_bit(1);
// 11000000111011
assert_eq!(a, 12347);

a.set_bit(14);
// 111000000111011
assert_eq!(a, 28731);
§Complexity
  • \( O(1) \) when setting an existing bit.
  • \( O(n) \) when setting a bit outside the current bit width, as this requires resizing.
Source

pub fn clear_bit(&mut self, i: BitCount) -> &mut Self

Clear bit i (zero-based indexing) of the absolute value of this integer, leaving its sign unchanged (unless it becomes zero from a negative self).

§Examples
use arbi::Arbi;

// 11000000111001 (absolute value of -12345)
let mut a = Arbi::from(-12345);

a.clear_bit(0);
// 11000000111000
assert_eq!(a, -12344);

a.clear_bit(13);
// 1000000111000
assert_eq!(a, -4152);

// Does nothing, as bits outside of the field defined by the indices
// [0, size_bits()) are treated as 0.
a.clear_bit(13);
assert_eq!(a, -4152);
§Complexity

\( O(1) \)

Source

pub fn invert_bit(&mut self, i: BitCount) -> &mut Self

If the bit at zero-based index i of the absolute value of this integer is 1, clear it to 0. Otherwise, set it to 1.

Please note that bits with indices outside of the range [0, size_bits()) are considered 0. Thus, inverting a bit outside of that range will set it to 1.

§Examples
use arbi::Arbi;
let mut a = Arbi::from(0xf); // 0b1111
a.invert_bit(0); // 0b1110
assert_eq!(a, 0b1110);
a.invert_bit(4); // 0b11110
assert_eq!(a, 0b11110);
§Complexity
  • \( O(1) \) when inverting an existing bit (i.e. a bit with index in [0, size_bits())).
  • \( O(n) \) otherwise.
Source§

impl Arbi

Source

pub fn abs(self) -> Arbi

Computes the absolute value of self.

§Examples
use arbi::Arbi;
let neg = Arbi::from(-123456789);
assert_eq!(neg.abs(), 123456789);
§Complexity

\( O(1) \)

Source

pub fn abs_mut(&mut self)

Computes the absolute value of self.

§Examples
use arbi::Arbi;
let mut neg = Arbi::from(-123456789);
neg.abs_mut();
assert_eq!(neg, 123456789);
§Complexity

\( O(1) \)

Source

pub fn abs_ref(&self) -> Arbi

Computes the absolute value of self.

§Examples
use arbi::Arbi;
let neg = Arbi::from(-123456789);
assert_eq!(neg.abs_ref(), 123456789);
§Complexity

\( O(n) \)

Source§

impl Arbi

Source

pub fn abs_diff(self, other: Self) -> Self

Computes the absolute difference between self and other.

§Examples
use arbi::Arbi;
assert_eq!(Arbi::from(8000).abs_diff(Arbi::from(10000)), 2000);
assert_eq!(Arbi::from(-10000).abs_diff(Arbi::from(8000)), 18000);
assert_eq!(Arbi::from(-10000).abs_diff(Arbi::from(-11000)), 1000);
§Complexity

\( O(n) \)

Source

pub fn abs_diff_mut(&mut self, other: &Self)

Computes the absolute difference between self and other.

§Examples
use arbi::{Arbi, Assign};

let mut a = Arbi::from(8000);

let b = Arbi::from(10000);
a.abs_diff_mut(&b);
assert_eq!(a, 2000);

a.assign(-10000);
let b = Arbi::from(8000);
a.abs_diff_mut(&b);
assert_eq!(a, 18000);

a.assign(-10000);
let b = Arbi::from(-11000);
a.abs_diff_mut(&b);
assert_eq!(a, 1000);
§Complexity

\( O(n) \)

Source

pub fn abs_diff_ref(&self, other: &Self) -> Self

Computes the absolute difference between self and other.

§Examples
use arbi::Arbi;
assert_eq!(Arbi::from(8000).abs_diff_ref(&Arbi::from(10000)), 2000);
assert_eq!(Arbi::from(-10000).abs_diff_ref(&Arbi::from(8000)), 18000);
assert_eq!(Arbi::from(-10000).abs_diff_ref(&Arbi::from(-11000)), 1000);
§Complexity

\( O(n) \)

Source§

impl Arbi

Source

pub fn count_ones(&self) -> u128

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

§Examples
use arbi::Arbi;

let a = Arbi::from(0b01001100u32);
assert_eq!(a.count_ones(), 3);

let max_u64 = Arbi::from(u64::MAX);
assert_eq!(max_u64.count_ones(), 64);

let zero = Arbi::zero();
assert_eq!(zero.count_ones(), 0);
§Complexity

\( O(n) \)

Source§

impl Arbi

Source

pub fn div_euclid_ref(&self, rhs: &Self) -> Arbi

Calculates the quotient of Euclidean division of self by rhs.

§See also
§Panics

This function will panic if rhs is 0.

§Examples
use arbi::Arbi;

let mut a = Arbi::from(9);
let mut b = Arbi::from(5);

assert_eq!(a.div_euclid_ref(&b), 1);

b.negate_mut();
assert_eq!(a.div_euclid_ref(&b), -1);

a.negate_mut();
b.negate_mut();
assert_eq!(a.div_euclid_ref(&b), -2);

b.negate_mut();
assert_eq!(a.div_euclid_ref(&b), 2);

Panics if rhs is zero:

use arbi::Arbi;

let num = Arbi::from(9);
let den = Arbi::zero();
num.div_euclid_ref(&den);
§Complexity

\( O(m \cdot n) \)

Source

pub fn rem_euclid_ref(&self, rhs: &Self) -> Arbi

Calculates the least nonnegative remainder of self (mod rhs).

§See also
§Panics

This function will panic if rhs is 0.

§Examples
use arbi::Arbi;

let mut a = Arbi::from(9);
let mut b = Arbi::from(5);

assert_eq!(a.rem_euclid_ref(&b), 4);

b.negate_mut();
assert_eq!(a.rem_euclid_ref(&b), 4);

a.negate_mut();
b.negate_mut();
assert_eq!(a.rem_euclid_ref(&b), 1);

b.negate_mut();
assert_eq!(a.rem_euclid_ref(&b), 1);

Panics if rhs is zero:

use arbi::Arbi;

let num = Arbi::from(9);
let den = Arbi::zero();
num.rem_euclid_ref(&den);
§Complexity

\( O(m \cdot n) \)

Source

pub fn divrem_euclid_ref(&self, rhs: &Self) -> (Arbi, Arbi)

Same as (self.div_euclid_ref(rhs), self.rem_euclid_ref(rhs)), but in one pass.

§Panics

This function will panic if rhs is 0.

§Examples
use arbi::Arbi;

let mut a = Arbi::from(9);
let mut b = Arbi::from(5);

let (quo, rem) = a.divrem_euclid_ref(&b);
assert!(quo == 1 && rem == 4);

b.negate_mut();
let (quo, rem) = a.divrem_euclid_ref(&b);
assert!(quo == -1 && rem == 4);

a.negate_mut();
b.negate_mut();
let (quo, rem) = a.divrem_euclid_ref(&b);
assert!(quo == -2 && rem == 1);

b.negate_mut();
let (quo, rem) = a.divrem_euclid_ref(&b);
assert!(quo == 2 && rem == 1);

Panics if rhs is zero:

use arbi::Arbi;

let num = Arbi::from(9);
let den = Arbi::zero();
num.divrem_euclid_ref(&den);
§Complexity

\( O(m \cdot n) \)

Source§

impl Arbi

Source

pub fn from_le_bytes(bytes: &[u8]) -> Self

Creates an Arbi integer from its representation as a byte array in little endian, interpreted as a nonnegative integer.

If bytes is empty, Arbi::zero() is returned.

§Examples
use arbi::Arbi;

let bytes = [0x78, 0x56, 0x34, 0x12, 0x34, 0x56, 0x78, 0x90];

let value = Arbi::from_le_bytes(&bytes);
assert_eq!(value, 0x9078563412345678_u64);
assert_eq!(value, u64::from_le_bytes(bytes));

let zero = Arbi::from_le_bytes(&[]);
assert_eq!(zero, 0);
Source

pub fn from_be_bytes(bytes: &[u8]) -> Self

Creates an Arbi integer from its representation as a byte array in big endian, interpreted as a nonnegative integer.

If bytes is empty, Arbi::zero() is returned.

§Examples
use arbi::Arbi;

let bytes = [0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78];

let value = Arbi::from_be_bytes(&bytes);
assert_eq!(value, 0x1234567812345678_u64);
assert_eq!(value, u64::from_be_bytes(bytes));

let zero = Arbi::from_be_bytes(&[]);
assert_eq!(zero, 0);
Source

pub fn from_le_bytes_signed(bytes: &[u8]) -> Self

Creates an Arbi integer from its representation as a byte array in little endian, interpreted as a signed integer.

If bytes is empty, Arbi::zero() is returned.

§Examples
use arbi::Arbi;

// Positive
let bytes = [0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12];
let value = Arbi::from_le_bytes_signed(&bytes);
assert_eq!(value, 0x1234567812345678_i64);
assert_eq!(value, i64::from_le_bytes(bytes));

// Negative
let bytes = [0xb3, 0xb3, 0xb4, 0xb5, 0xb2, 0xb3, 0xb4, 0xb5];
let value = Arbi::from_le_bytes_signed(&bytes);
assert_eq!(value, i64::from_le_bytes(bytes));

// Zero
let bytes = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00];
let value = Arbi::from_le_bytes_signed(&bytes);
assert_eq!(value, 0);
assert_eq!(value, i64::from_le_bytes(bytes));

let zero = Arbi::from_le_bytes_signed(&[]);
assert_eq!(zero, 0);
Source

pub fn from_be_bytes_signed(bytes: &[u8]) -> Self

Creates an Arbi integer from its representation as a byte array in big endian, interpreted as a signed integer.

If bytes is empty, Arbi::zero() is returned.

§Examples
use arbi::Arbi;

// Positive
let bytes = [0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78];
let value = Arbi::from_be_bytes_signed(&bytes);
assert_eq!(value, 0x1234567812345678_i64);
assert_eq!(value, i64::from_be_bytes(bytes));

// Negative
let bytes = [0xb5, 0xb4, 0xb3, 0xb2, 0xb5, 0xb4, 0xb3, 0xb3];
let value = Arbi::from_be_bytes_signed(&bytes);
assert_eq!(value, i64::from_be_bytes(bytes));

// Zero
let bytes = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00];
let value = Arbi::from_be_bytes_signed(&bytes);
assert_eq!(value, 0);
assert_eq!(value, i64::from_be_bytes(bytes));

let zero = Arbi::from_be_bytes_signed(&[]);
assert_eq!(zero, 0);
Source

pub fn from_ne_bytes(bytes: &[u8]) -> Self

Creates an integer value from its memory representation as a byte array in native endianness, interpreted as a nonnegative integer.

§Examples
use arbi::Arbi;

let bytes = if cfg!(target_endian = "big") {
    [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]
} else {
    [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
};

let a = Arbi::from_ne_bytes(&bytes);
assert_eq!(a, 0x1234567890123456_i64);
assert_eq!(a, i64::from_ne_bytes(bytes));
Source

pub fn from_ne_bytes_signed(bytes: &[u8]) -> Self

Creates an integer value from its memory representation as a byte array in native endianness, interpreted as a signed integer.

§Examples
use arbi::Arbi;

let bytes = if cfg!(target_endian = "big") {
    [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]
} else {
    [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
};

let a = Arbi::from_ne_bytes_signed(&bytes);
assert_eq!(a, 0x1234567890123456_i64);
assert_eq!(a, i64::from_ne_bytes(bytes));
Source§

impl Arbi

Source

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

Returns the base-base logarithm of the number, rounded down.

§Panics

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

§Examples
use arbi::Arbi;
let a = Arbi::from(10);
assert_eq!(a.ilog(8), 1);

Nonpositive values panic:

use arbi::Arbi;
let zero = Arbi::zero();
zero.ilog(8);
use arbi::Arbi;
let minus_one = Arbi::neg_one();
minus_one.ilog(8);

A base less than 2 causes a panic

use arbi::Arbi;
let a = Arbi::from(4);
a.ilog(1);
Source

pub fn ilog_mut(&mut self, base: u32) -> BitCount

Returns the base-base logarithm of the number, rounded down.

§Panics

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

§Examples
use arbi::Arbi;
let mut a = Arbi::from(10);
a.ilog_mut(8);
assert_eq!(a, 1);

Nonpositive values panic:

use arbi::Arbi;
let mut zero = Arbi::zero();
zero.ilog_mut(8);
use arbi::Arbi;
let mut minus_one = Arbi::neg_one();
minus_one.ilog_mut(8);

A base less than 2 causes a panic

use arbi::Arbi;
let mut a = Arbi::from(4);
a.ilog_mut(1);
Source

pub fn ilog_ref(&self, base: u32) -> BitCount

Returns the base-base logarithm of the number, rounded down.

§Panics

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

§Examples
use arbi::Arbi;
let a = Arbi::from(10);
assert_eq!(a.ilog_ref(8), 1);

Nonpositive values panic:

use arbi::Arbi;
let zero = Arbi::zero();
zero.ilog_ref(8);
use arbi::Arbi;
let minus_one = Arbi::neg_one();
minus_one.ilog_ref(8);

A base less than 2 causes a panic

use arbi::Arbi;
let a = Arbi::from(4);
a.ilog_ref(1);
Source§

impl Arbi

Source

pub fn ilog10(self) -> BitCount

Returns the base 10 logarithm of the number, rounded down.

§Panics

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

§Examples
use arbi::Arbi;
let a = Arbi::from(10);
assert_eq!(a.ilog10(), 1);

Nonpositive values panic:

use arbi::Arbi;
let zero = Arbi::zero();
zero.ilog10();
use arbi::Arbi;
let neg_one = Arbi::neg_one();
neg_one.ilog10();
Source

pub fn ilog10_mut(&mut self) -> BitCount

Returns the base 10 logarithm of the number, rounded down.

The value of self will compare equal to the return value.

§Panics

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

§Examples
use arbi::Arbi;
let mut a = Arbi::from(10);
assert_eq!(a.ilog10_mut(), 1);
assert_eq!(a, 1);

Nonpositive values panic:

use arbi::Arbi;
let mut zero = Arbi::zero();
zero.ilog10_mut();
use arbi::Arbi;
let mut minus_one = Arbi::neg_one();
minus_one.ilog10_mut();
Source

pub fn ilog10_ref(&self) -> BitCount

Returns the base 10 logarithm of the number, rounded down.

§Panics

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

§Examples
use arbi::Arbi;
let a = Arbi::from(10);
assert_eq!(a.ilog10_ref(), 1);

Nonpositive values panic:

use arbi::Arbi;
let zero = Arbi::zero();
zero.ilog10_ref();
use arbi::Arbi;
let minus_one = Arbi::neg_one();
minus_one.ilog10_ref();
Source§

impl Arbi

Source

pub fn ilog2(&self) -> BitCount

Returns the base 2 logarithm of the number, rounded down.

§Panics

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

§Examples
use arbi::{Arbi, BitCount};

let a = Arbi::from(2);
assert_eq!(a.ilog2(), 1);
assert_eq!(2_i32.ilog2(), 1);

let b = Arbi::from(123456789_i32);
assert_eq!(b.ilog2(), 26);
assert_eq!(123456789_i32.ilog2(), 26);

let c = Arbi::from(u128::MAX);
assert_eq!(c.ilog2(), u128::MAX.ilog2() as BitCount);

This function will panic if self is zero or negative:

use arbi::Arbi;
let a = Arbi::zero();
a.ilog2();
use arbi::Arbi;
let a = Arbi::neg_one();
a.ilog2();
§Complexity

\( O(1) \)

Source§

impl Arbi

Source

pub fn is_positive(&self) -> bool

Returns true if self is positive and false if the number is zero or negative.

§Examples
use arbi::Arbi;

let neg = Arbi::from(-1234);
let pos = Arbi::from(1234);
let zer = Arbi::zero();

assert!(!neg.is_positive());
assert!(pos.is_positive());
assert!(!zer.is_positive());
§Complexity

\( O(1) \)

Source

pub fn is_negative(&self) -> bool

Returns true if self is negative and false if the number is zero or positive.

§Examples
use arbi::Arbi;

let neg = Arbi::from(-1234);
let pos = Arbi::from(1234);
let zer = Arbi::zero();

assert!(neg.is_negative());
assert!(!pos.is_negative());
assert!(!zer.is_negative());
§Complexity

\( O(1) \)

Source§

impl Arbi

Source

pub fn is_power_of_two(&self) -> bool

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

That is, return true iff the absolute value of this integer is a power of 2.

§Examples
use arbi::Arbi;

let one = Arbi::one();
assert!(one.is_power_of_two());
assert!(1u32.is_power_of_two());

let two = Arbi::from(2);
assert!(two.is_power_of_two());
assert!(2u32.is_power_of_two());

let a = Arbi::from(32);
assert!(a.is_power_of_two());
assert!(32u32.is_power_of_two());

let b = Arbi::from(30);
assert!(!b.is_power_of_two());
assert!(!(30u32.is_power_of_two()));

let base = Arbi::from(Arbi::BASE);
assert!(base.is_power_of_two());
Source§

impl Arbi

Source

pub fn leading_ones(&self) -> u128

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

§Examples
use arbi::Arbi;

let zero = Arbi::zero();
assert_eq!(zero.leading_ones(), 0);

let a = Arbi::from(u128::MAX);
assert_eq!(a.leading_ones(), 128);

let b = Arbi::from(u128::MAX - 1);
assert_eq!(b.leading_ones(), 127);
§Complexity

\( O(n) \)

Source§

impl Arbi

Source

pub fn reverse_bits(self) -> Self

Reverses the order of bits in the absolute value of the integer.

The least significant bit becomes the most significant bit, second least significant bit becomes second most-significant bit, etc.

The sign remains unchanged.

§Examples
use arbi::Arbi;
let a = Arbi::from(0x12345678_u32);
assert_eq!(a.reverse_bits(), 0x12345678_u32.reverse_bits());
§Complexity

\( O(n) \)

Source

pub fn reverse_bits_mut(&mut self)

Reverses the order of bits in the absolute value of the integer.

The least significant bit becomes the most significant bit, second least significant bit becomes second most-significant bit, etc.

The sign remains unchanged.

§Examples
use arbi::Arbi;
let mut a = Arbi::from(0x12345678_u32);
a.reverse_bits_mut();
assert_eq!(a, 0x12345678_u32.reverse_bits());
Source

pub fn reverse_bits_ref(&self) -> Self

Reverses the order of bits in the absolute value of the integer.

The least significant bit becomes the most significant bit, second least significant bit becomes second most-significant bit, etc.

The sign remains unchanged.

§Examples
use arbi::Arbi;
let a = Arbi::from(0x12345678_u32);
let b: Arbi = a.reverse_bits_ref();
assert_eq!(b, 0x12345678_u32.reverse_bits());
Source§

impl Arbi

Source

pub fn signum(&self) -> i32

Returns a number representing the sign of self.

  • 0 if the number if zero.
  • 1 if the number if positive.
  • -1 if the number is negative.
§Examples
use arbi::Arbi;

let zero = Arbi::zero();
assert_eq!(zero.signum(), 0);
assert_eq!(0i32.signum(), 0);

let one = Arbi::one();
assert_eq!(one.signum(), 1);
assert_eq!(1i32.signum(), 1);

let neg_one = Arbi::neg_one();
assert_eq!(neg_one.signum(), -1);
assert_eq!((-1i32).signum(), -1);
§Complexity

\( O(1) \)

Source§

impl Arbi

Source

pub fn swap_bytes(self) -> Self

Reverses the byte order of the absolute value of the integer.

The sign remains unchanged.

§Examples
use arbi::Arbi;
let a = Arbi::from(0x12345678_u32);
assert_eq!(a.swap_bytes(), 0x78563412);
§Complexity

\( O(n) \)

Source

pub fn swap_bytes_mut(&mut self)

Reverses the byte order of the absolute value of the integer.

The sign remains unchanged.

§Examples
use arbi::Arbi;
let mut a = Arbi::from(0x12345678_u32);
a.swap_bytes_mut();
assert_eq!(a, 0x78563412);
Source

pub fn swap_bytes_ref(&self) -> Self

Reverses the byte order of the absolute value of the integer.

The sign remains unchanged.

§Examples
use arbi::Arbi;
let a = Arbi::from(0x12345678_u32);
assert_eq!(a.swap_bytes_ref(), 0x78563412);
Source§

impl Arbi

Source

pub fn to_le_bytes(&self) -> Vec<u8>

Returns the memory representation of this integer as a byte Vec in little-endian byte order, interpreted as a nonnegative integer.

§Examples
use arbi::Arbi;

let a = Arbi::from(0x1234567890123456_u64);

let bytes = a.to_le_bytes();
assert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
assert_eq!(bytes, 0x1234567890123456_u64.to_le_bytes());
§Complexity

\( O(n) \)

Source

pub fn to_be_bytes(&self) -> Vec<u8>

Returns the memory representation of this integer as a byte Vec in big-endian (network) byte order, interpreted as a nonnegative integer.

§Examples
use arbi::Arbi;

let a = Arbi::from(0x1234567890123456_u64);

let bytes = a.to_be_bytes();
assert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
assert_eq!(bytes, 0x1234567890123456_u64.to_be_bytes());
§Complexity

\( O(n) \)

Source

pub fn to_le_bytes_signed(&self) -> Vec<u8>

Returns the memory representation of this integer as a byte Vec in little-endian byte order, interpreted as a signed integer.

§Examples
use arbi::Arbi;

let a = Arbi::from(-0x1234567890123456_i64);

let bytes = a.to_le_bytes_signed();
assert_eq!(bytes, (-0x1234567890123456_i64).to_le_bytes());
§Complexity

\( O(n) \)

Source

pub fn to_be_bytes_signed(&self) -> Vec<u8>

Returns the memory representation of this integer as a byte Vec in big-endian (network) byte order, interpreted as a signed integer.

§Examples
use arbi::Arbi;

let a = Arbi::from(-0x1234567890123456_i64);

let bytes = a.to_be_bytes_signed();
assert_eq!(bytes, (-0x1234567890123456_i64).to_be_bytes());
§Complexity

\( O(n) \)

Source

pub fn to_ne_bytes(&self) -> Vec<u8>

Returns the memory representation of the absolute value of this integer as a byte Vec in native byte order.

§Examples
use arbi::Arbi;

let a = Arbi::from(0x1234567890123456_i64);
assert_eq!(a.to_ne_bytes(), 0x1234567890123456_i64.to_ne_bytes());
Source

pub fn to_ne_bytes_signed(&self) -> Vec<u8>

Returns the memory representation of this integer as a byte Vec in native byte order.

§Examples
use arbi::Arbi;

let a = Arbi::from(-0x1234567890123456_i64);
assert_eq!(
    a.to_ne_bytes_signed(),
    (-0x1234567890123456_i64).to_ne_bytes()
);
Source§

impl Arbi

Source

pub fn trailing_ones(&self) -> u128

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

§Examples
use arbi::Arbi;

let zero = Arbi::zero();
assert_eq!(zero.trailing_ones(), 0);

let a = Arbi::from(u128::MAX);
assert_eq!(a.trailing_ones(), 128);

let b = Arbi::from(u128::MAX - 1);
assert_eq!(b.trailing_ones(), 0);
§Complexity

\( O(n) \)

Source§

impl Arbi

Source

pub const MAX_CAPACITY: usize = 536_870_911usize

Maximum capacity for the internal vector of digits.

Vec is limited to isize::MAX bytes in capacity. A digit has size in bytes core::mem::size_of::<Digit>(). The maximum capacity is therefore isize::MAX / core::mem::size_of::<Digit>().

Source

pub const MAX_BITS: BitCount = 17_179_869_152u128

Maximum capacity for the internal vector of digits, in terms of bits.

This represents the number of bits that can be used to represent the absolute value of the integer when the internal digit vector is at maximum capacity.

This is Arbi::MAX_CAPACITY * Digit::BITS.

Source

pub fn capacity(&self) -> usize

Returns the total number of elements the internal digit vector can hold without reallocating.

§Examples
use arbi::{Arbi, Assign};

let zero = Arbi::zero();
assert_eq!(zero.capacity(), 0);

let mut b = Arbi::with_capacity(10);
assert_eq!(b.capacity(), 10);

b.assign(u64::MAX); // no memory allocation needed
assert_eq!(b, u64::MAX);
§Complexity

\( O(1) \)

Source

pub fn capacity_bits(&self) -> BitCount

Return the total number of bits the current capacity can hold to represent the absolute value of this integer.

§Examples
use arbi::{Arbi, BitCount, Digit};

let zero = Arbi::zero();
assert_eq!(zero.capacity_bits(), 0);

let a = Arbi::with_capacity_bits(Digit::BITS as BitCount);
assert!(a.capacity_bits() >= Digit::BITS as BitCount);
§Complexitys

\( O(1) \)

Source

pub fn with_capacity(capacity: usize) -> Self

Construct a new Arbi integer with at least the specified capacity, in terms of Digits.

The integer’s value will be 0.

§Examples
use arbi::Arbi;

let a = Arbi::with_capacity(10);
assert_eq!(a.capacity(), 10);
assert_eq!(a, 0);

Panics if the new capacity exceeds Arbi::MAX_CAPACITY digits:

use arbi::Arbi;

let a = Arbi::with_capacity(Arbi::MAX_CAPACITY + 1);
§Panic

Panics if the new capacity exceeds isize::MAX bytes (or Arbi::MAX_CAPACITY digits) or if the allocator reports an allocation failure.

Source

pub fn with_capacity_bits(capacity: BitCount) -> Self

Construct a new Arbi integer with at least the specified capacity, in terms of bits.

The integer’s value will be 0.

§Examples
use arbi::{Arbi, BitCount, Digit};

let a = Arbi::with_capacity_bits(Digit::BITS as BitCount - 1);
assert_eq!(a.capacity(), 1);
assert_eq!(a, 0);

let a = Arbi::with_capacity_bits(Digit::BITS as BitCount);
assert_eq!(a.capacity(), 1);

let a = Arbi::with_capacity_bits(Digit::BITS as BitCount + 1);
assert_eq!(a.capacity(), 2);

Panics if the new capacity in bits exceeds Arbi::MAX_BITS bits:

use arbi::Arbi;

// Panics with message: "New capacity exceeds `isize::MAX` bytes".
let a = Arbi::with_capacity_bits(Arbi::MAX_BITS + 1);

Note that, in practice, while the theoretical limit for the capacity of a Vec in bytes is isize::MAX, memory allocation failures typically happen for less.

§Panic

Panics if the new capacity exceeds isize::MAX bytes (or Arbi::MAX_BITS digits) or if the allocator reports an allocation failure.

Source§

impl Arbi

Source

pub fn divrem(&self, other: &Arbi) -> (Arbi, Arbi)

Computes both the quotient and remainder of division of this Arbi object by another Arbi object and returns both the quotient and the remainder as a pair.

In Rust, integer division rounds towards zero and given remainder = dividend % divisor, remainder will have the same sign as the dividend. The behavior of division in this crate is consistent with that of division of integer primitive types.

Generally speaking, division algorithms calculate both the quotient and remainder simultaneously. If you need both, it is best to ask for both in one step rather than use the / and % operators in turn.

§Parameters
  • other: The divisor.
§Panic
Panics if a division by zero attempt is detected, consistent with the built-in behavior of dividing a primitive integer value by zero.
§Return

A pair of Arbi integers where the first element is the quotient and the second element is the remainder.

§Examples
use arbi::{Arbi, Assign};

let num = Arbi::from_str_radix(
    "100000000000000000000000000000000000000000000000000",
    16,
)
.unwrap();
let mut den =
    Arbi::from_str_radix("40000000000000000000000000000000000000", 16)
        .unwrap();

let (quo, rem) = num.divrem(&den);
assert_eq!(quo, 1125899906842624_u64);
assert_eq!(rem, 0);

if let Err(e) = den.assign_str_radix(
    "-10b67ec03f7d363506c60c8c877b6f92be8f41518c16aa3187",
    16,
) {
    panic!("Parse error: {}", e);
}

let (quo, rem) = num.divrem(&den);
let expected_rem = Arbi::from_str_radix(
    "54e92bc47a9d2e49a6543c40fc47666d59b2c38caac071917",
    16,
)
.unwrap();
assert_eq!(quo, -15);
assert_eq!(rem, expected_rem);

// We can also use the / and % operators in turn to get the same result,
// but that would involve two passes through the division algorithm.
assert_eq!(&num / &den, -15);
assert_eq!(&num % &den, expected_rem);

Dividing an Arbi integer by zero panics:

use arbi::Arbi;

let x = Arbi::from_str_radix("123456789", 10).unwrap();
let (quo, rem) = x.divrem(&Arbi::zero());

Dividing a primitive integer value by zero panics:

#![allow(unconditional_panic)]
let zero = 0;
let x = -123456789 / zero;
§Complexity

\( O(m \cdot n) \)

Source§

impl Arbi

Source

pub fn fits<T: Fits<T>>(&self) -> bool

Return true if this Arbi integer fits in the range of the target type.

§Examples
use arbi::{Arbi, Fits};

let mut x = Arbi::from(255);
assert!(x.fits::<u8>());

x.incr();

assert!(!x.fits::<u8>());
Source§

impl Arbi

Source

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

Equivalent to Arbi::from_str_base(), but panics if the base is invalid (i.e. not in \( [2, 36] \)).

§Examples
use arbi::{Arbi, Base};

let x = Arbi::from_str_radix("987654321", 10).unwrap();
assert_eq!(x, 987654321);
Source

pub fn from_str_base(s: &str, base: Base) -> Result<Self, ParseError>

Construct an integer from a string representing a base-base integer.

Allows leading whitespace and/or a plus/minus sign before the first base-base digit. base must be an integer in \( [2, 36] \). Trailing whitespace is ignored.

§Examples
use arbi::{base::DEC, Arbi};

let x = Arbi::from_str_base("987654321", DEC).unwrap();
assert_eq!(x, 987654321);
Source§

impl Arbi

Source

pub fn incr(&mut self) -> &mut Self

Increment this integer in-place by one.

§Examples
use arbi::Arbi;

let mut x = Arbi::from(987654321);
x.incr();
assert_eq!(x, 987654322);
Source

pub fn decr(&mut self) -> &mut Self

Decrement this integer in-place by one.

§Examples
use arbi::Arbi;

let mut x = Arbi::from(987654321);
x.decr();
assert_eq!(x, 987654320);
Source§

impl Arbi

Source

pub fn is_odd(&self) -> bool

Return true if this integer is odd, false otherwise.

§Examples
use arbi::Arbi;
let zero = Arbi::zero();
assert!(!zero.is_odd());
let a = Arbi::from(-123456789);
assert!(a.is_odd());
let b = Arbi::from(-12345678);
assert!(!b.is_odd());
§Complexity

\( O(1) \)

Source

pub fn is_even(&self) -> bool

Return true if this integer is even, false otherwise.

§Examples
use arbi::Arbi;

let zero = Arbi::zero();
assert!(zero.is_even());
let a = Arbi::from(-12345678);
assert!(a.is_even());
let b = Arbi::from(-123456789);
assert!(!b.is_even());
§Complexity

\( O(1) \)

Source§

impl Arbi

Source

pub fn is_zero(&self) -> bool

Return true if this integer is zero, false otherwise.

§Examples
use arbi::Arbi;
let zero = Arbi::zero();
assert!(zero.is_zero());
let one = Arbi::one();
assert!(!one.is_zero());
let neg_one = Arbi::neg_one();
assert!(!neg_one.is_zero());
§Complexity

\( O(1) \)

Source§

impl Arbi

Source

pub fn negate(self) -> Self

Negates the integer, in-place.

§Examples
use arbi::Arbi;
let mut pos = Arbi::from(123456789);
pos = pos.negate();
assert_eq!(pos, -123456789);
pos = pos.negate();
assert_eq!(pos, 123456789);
§Complexity

\( O(1) \)

Source

pub fn negate_mut(&mut self)

Negates the integer, in-place.

§Examples
use arbi::Arbi;
let mut pos = Arbi::from(123456789);
pos.negate_mut();
assert_eq!(pos, -123456789);
pos.negate_mut();
assert_eq!(pos, 123456789);
§Complexity

\( O(1) \)

Source

pub fn negate_ref(&self) -> Self

Return a new integer representing this integer negated.

§Examples
use arbi::Arbi;
let pos = Arbi::from(123456789);
assert_eq!(pos.negate_ref(), -123456789);
let neg = Arbi::from(-123456789);
assert_eq!(neg.negate_ref(), 123456789);
§Complexity

\( O(n) \)

Source§

impl Arbi

Source

pub const fn new() -> Self

Return an Arbi integer with value 0.

No memory allocation occurs.

Arbi::new(), Arbi::zero(), and Arbi::default() are equivalent, except that Arbi::default() is not const.

§Examples
use arbi::Arbi;
let zero = Arbi::new();
assert_eq!(zero, 0);
§Complexity

\( O(1) \)

Source§

impl Arbi

Source

pub fn sign(&self) -> Ordering

Return an Ordering indicating the sign of the number: Ordering::Less for negative, Ordering::Equal for zero, Ordering::Greater for positive.

§Examples
use arbi::Arbi;
use core::cmp::Ordering;

let neg = Arbi::from(-123456789);
let zer = Arbi::zero();
let pos = Arbi::from(123456789);

assert_eq!(neg.sign(), Ordering::Less);
assert_eq!(zer.sign(), Ordering::Equal);
assert_eq!(pos.sign(), Ordering::Greater);
§Complexity

\( O(1) \)

Source§

impl Arbi

Source

pub fn size(&self) -> usize

Return the number of Digits used to represent the absolute value of this integer.

Instance represents 0 if and only if size() == 0.

§Examples
use arbi::{Arbi, Digit};

let zero = Arbi::zero();
assert_eq!(zero.size(), 0);

let mut a = Arbi::from(Digit::MAX);
assert_eq!(a.size(), 1);

a.incr();
assert_eq!(a.size(), 2);
§Complexity

\( O(1) \)

Source

pub fn size_bits(&self) -> BitCount

Return the number of bits needed to represent the absolute value of this integer.

Instance represents 0 if and only if size_bits() == 0.

§Examples
use arbi::{Arbi, BitCount, Digit};

let zero = Arbi::zero();
assert_eq!(zero.size_bits(), 0);

let mut a = Arbi::from(Digit::MAX);
assert_eq!(a.size_bits(), Digit::BITS as BitCount);
a.incr();
assert_eq!(a.size_bits(), Digit::BITS as BitCount + 1);
§Complexity

\( O(1) \)

Source

pub fn size_base(self, base: u32) -> BitCount

Return the number of base-base digits needed to represent the absolute value of this integer.

Instance represents 0 if and only if size_base() == 0.

§Panics

This function will panic if base is less than or equal to 1.

§Examples
use arbi::Arbi;
let zero = Arbi::zero();
assert_eq!(zero.size_base(10), 0);
let one = Arbi::one();
assert_eq!(one.size_base(10), 1);
let a = Arbi::from_str_radix("123456789", 10).unwrap();
assert_eq!(a.size_base(10), 9);

Panics on a base less than or equal to 1:

use arbi::Arbi;
let a = Arbi::from(1234);
a.size_base(1);
Source

pub fn size_base_mut(&mut self, base: u32) -> BitCount

Return the number of base-base digits needed to represent the absolute value of this integer.

Instance represents 0 if and only if size_base_mut() == 0.

The value of self will compare equal to the return value.

§Panics

This function will panic if base is less than or equal to 1.

§Examples
use arbi::Arbi;

let mut zero = Arbi::zero();
assert_eq!(zero.size_base_mut(10), 0);
assert_eq!(zero, 0);

let mut one = Arbi::one();
assert_eq!(one.size_base_mut(10), 1);
assert_eq!(one, 1);

let mut a = Arbi::from_str_radix("123456789", 10).unwrap();
assert_eq!(a.size_base_mut(10), 9);
assert_eq!(a, 9);

Panics on a base less than or equal to 1:

use arbi::Arbi;
let mut a = Arbi::from(1234);
a.size_base_mut(1);
Source

pub fn size_base_ref(&self, base: u32) -> BitCount

Return the number of base-base digits needed to represent the absolute value of this integer.

Instance represents 0 if and only if size_base_ref() == 0.

§Panics

This function will panic if base is less than or equal to 1.

§Examples
use arbi::Arbi;

let zero = Arbi::zero();
assert_eq!(zero.size_base_ref(10), 0);

let one = Arbi::one();
assert_eq!(one.size_base_ref(10), 1);

let a = Arbi::from_str_radix("123456789", 10).unwrap();
assert_eq!(a.size_base_ref(10), 9);

Panics on a base less than or equal to 1:

use arbi::Arbi;
let a = Arbi::from(1234);
a.size_base_ref(1);
Source§

impl Arbi

Source

pub fn to_f64(&self) -> f64

Convert this integer to a floating-point value.

The semantics of this function are consistent with Rust’s built-in behavior for casting from an integer to a float.

§Examples
use arbi::{Arbi, Pow};

let a = Arbi::from(-987654321);
assert_eq!(a.to_f64(), -987654321.0);

let b = Arbi::from(1_u64 << 32);
assert_ne!((&b).pow(31_usize).to_f64(), f64::INFINITY);
assert_eq!((&b).pow(32_usize).to_f64(), f64::INFINITY);
§Complexity

\( O(1) \)

Source§

impl Arbi

Source

pub fn wrapping_to_i8(&self) -> i8

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_i8(&self) -> Option<i8>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_i8(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn wrapping_to_i16(&self) -> i16

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_i16(&self) -> Option<i16>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_i16(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn wrapping_to_i32(&self) -> i32

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_i32(&self) -> Option<i32>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_i32(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn wrapping_to_i64(&self) -> i64

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_i64(&self) -> Option<i64>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_i64(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn wrapping_to_i128(&self) -> i128

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_i128(&self) -> Option<i128>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_i128(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn wrapping_to_isize(&self) -> isize

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_isize(&self) -> Option<isize>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_isize(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn wrapping_to_u8(&self) -> u8

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_u8(&self) -> Option<u8>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_u8(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn wrapping_to_u16(&self) -> u16

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_u16(&self) -> Option<u16>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_u16(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn wrapping_to_u32(&self) -> u32

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_u32(&self) -> Option<u32>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_u32(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn wrapping_to_u64(&self) -> u64

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_u64(&self) -> Option<u64>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_u64(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn wrapping_to_u128(&self) -> u128

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_u128(&self) -> Option<u128>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_u128(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn wrapping_to_usize(&self) -> usize

Convert this Arbi integer to a primitive integer type value.

This is “wrapping”.

§Note
  • From<Arbi> and From<&Arbi> are implemented for each primitive integral type and has the same semantics. See, for example, impl From<&Arbi> for i32.
  • In Rust, casting from a larger primitive integer type to a smaller integer type truncates. This function has the same semantics.
§Return

Return the unique value of this target primitive integer type that is congruent to the Arbi integer, modulo \( 2^{N} \), where \( N \) is the width of the target type.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y: i32 = x.wrapping_to_i32();
let z: i16 = x.wrapping_to_i16();
assert_eq!(y, i32::MIN);
assert_eq!(z, i32::MIN as i16);
assert_eq!(i16::from(&x), i32::MIN as i16);
Source

pub fn checked_to_usize(&self) -> Option<usize>

Convert this Arbi integer to a primitive integer type value.

§Return

Some(value) if the Arbi value fits within the target type’s range, None otherwise.

§Examples
use arbi::Arbi;
let x = Arbi::from(i32::MIN);
let y = x.checked_to_i32();
assert_eq!(y, Some(i32::MIN));
let z = x.checked_to_i16();
assert!(z.is_none());
Source

pub fn fits_usize(&self) -> bool

Return true if this integer fits in this primitive integer type, false otherwise.

§Examples
use arbi::Arbi;
let mut x = Arbi::from(u8::MAX);
assert!(x.fits_u8());
x.incr();
assert!(!x.fits_u8());
Source§

impl Arbi

Source

pub fn to_string_base(&self, base: Base) -> String

Return a String containing the base-base representation of the integer, where base must be an integer in \( [2, 36] \).

§Examples
use arbi::{Arbi, Base};

let b10 = Base::try_from(10).unwrap();

let a = Arbi::from(123456789);
let s = a.to_string_base(b10);
assert_eq!(s, "123456789");
Source

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

Equivalent to Arbi::to_string_base(), but panics if the base is invalid (i.e. not in \( [2, 36] \)).

§Examples
use arbi::{Arbi, Base};

let a = Arbi::from(123456789);
let s = a.to_string_radix(10);
assert_eq!(s, "123456789");
Source§

impl Arbi

Source

pub const ZERO: Arbi = _

A constant Arbi integer representing 0.

Source

pub const fn zero() -> Self

Return an Arbi integer with value 0.

Equivalent to Arbi::new().

§Examples
use arbi::Arbi;
let zero = Arbi::zero();
assert_eq!(zero, 0);
§Complexity

\( O(1) \)

Source

pub fn one() -> Self

Return an Arbi integer with value 1.

§Examples
use arbi::Arbi;
let one = Arbi::one();
assert_eq!(one, 1);
§Complexity

\( O(1) \)

Source

pub fn neg_one() -> Self

Return an Arbi integer with value -1.

§Examples
use arbi::Arbi;
let neg_one = Arbi::neg_one();
assert_eq!(neg_one, -1);
§Complexity

\( O(1) \)

Source§

impl Arbi

Source

pub const BASE: u64 = 4_294_967_296u64

Base used for the internal representation of the integer.

Trait Implementations§

Source§

impl<'b> Add<&'b Arbi> for &Arbi

Implements &self + &rhs.

§Examples

use arbi::Arbi;
let a = Arbi::from(-1234567);
let b = Arbi::from(-123456);
let c = &a + &b;
assert_eq!(c, -1358023);

§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &'b Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &i128

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &i16

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &i32

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &i64

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &i8

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &isize

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &u128

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &u16

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &u32

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &u64

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &u8

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for &usize

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl<'a> Add<&'a Arbi> for Arbi

Implements self + &rhs.

§Examples

use arbi::Arbi;
let a = Arbi::from(-1234567);
let b = Arbi::from(-123456);
let c = a + &b;
assert_eq!(c, -1358023);

§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a Arbi) -> Self

Performs the + operation. Read more
Source§

impl Add<&Arbi> for i128

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for i16

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for i32

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for i64

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for i8

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for isize

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for u128

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for u16

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for u32

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for u64

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for u8

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&Arbi> for usize

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&i128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &i128) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&i128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &i128) -> Self

Performs the + operation. Read more
Source§

impl Add<&i16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &i16) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&i16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &i16) -> Self

Performs the + operation. Read more
Source§

impl Add<&i32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &i32) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &i32) -> Self

Performs the + operation. Read more
Source§

impl Add<&i64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &i64) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&i64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &i64) -> Self

Performs the + operation. Read more
Source§

impl Add<&i8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &i8) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&i8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &i8) -> Self

Performs the + operation. Read more
Source§

impl Add<&isize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &isize) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&isize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &isize) -> Self

Performs the + operation. Read more
Source§

impl Add<&u128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &u128) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &u128) -> Self

Performs the + operation. Read more
Source§

impl Add<&u16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &u16) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&u16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &u16) -> Self

Performs the + operation. Read more
Source§

impl Add<&u32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &u32) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &u32) -> Self

Performs the + operation. Read more
Source§

impl Add<&u64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &u64) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&u64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &u64) -> Self

Performs the + operation. Read more
Source§

impl Add<&u8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &u8) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&u8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &u8) -> Self

Performs the + operation. Read more
Source§

impl Add<&usize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &usize) -> Arbi

Performs the + operation. Read more
Source§

impl Add<&usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: &usize) -> Self

Performs the + operation. Read more
Source§

impl Add<Arbi> for &Arbi

Implements &self + rhs.

§Examples

use arbi::{Arbi, Digit};

let a = Arbi::from(-123456);
let b = Arbi::from(1234567);
let b_cap = b.capacity();
let c = &a + b; // In this case, no memory allocation (b's memory is
                // used.
assert_eq!(c, 1111111);
assert_eq!(c.capacity(), b_cap);

let a = Arbi::from(-(Digit::MAX as i128));
let b = Arbi::from(-1234567);
let b_cap = b.capacity();
let c = &a + b; // In this case, memory allocation may or may not occur,
                // depending on b's capacity.
assert!(c.capacity() >= b_cap);

§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &i128

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &i16

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &i32

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &i64

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &i8

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &isize

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &u128

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &u16

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &u32

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &u64

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &u8

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for &usize

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for i128

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for i16

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for i32

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for i64

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for i8

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for isize

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for u128

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for u16

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for u32

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for u64

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for u8

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<Arbi> for usize

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: Arbi) -> Arbi

Performs the + operation. Read more
Source§

impl Add<i128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: i128) -> Arbi

Performs the + operation. Read more
Source§

impl Add<i128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: i128) -> Self

Performs the + operation. Read more
Source§

impl Add<i16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: i16) -> Arbi

Performs the + operation. Read more
Source§

impl Add<i16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: i16) -> Self

Performs the + operation. Read more
Source§

impl Add<i32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: i32) -> Arbi

Performs the + operation. Read more
Source§

impl Add<i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: i32) -> Self

Performs the + operation. Read more
Source§

impl Add<i64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: i64) -> Arbi

Performs the + operation. Read more
Source§

impl Add<i64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: i64) -> Self

Performs the + operation. Read more
Source§

impl Add<i8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: i8) -> Arbi

Performs the + operation. Read more
Source§

impl Add<i8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: i8) -> Self

Performs the + operation. Read more
Source§

impl Add<isize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: isize) -> Arbi

Performs the + operation. Read more
Source§

impl Add<isize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: isize) -> Self

Performs the + operation. Read more
Source§

impl Add<u128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: u128) -> Arbi

Performs the + operation. Read more
Source§

impl Add<u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: u128) -> Self

Performs the + operation. Read more
Source§

impl Add<u16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: u16) -> Arbi

Performs the + operation. Read more
Source§

impl Add<u16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: u16) -> Self

Performs the + operation. Read more
Source§

impl Add<u32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: u32) -> Arbi

Performs the + operation. Read more
Source§

impl Add<u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: u32) -> Self

Performs the + operation. Read more
Source§

impl Add<u64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: u64) -> Arbi

Performs the + operation. Read more
Source§

impl Add<u64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: u64) -> Self

Performs the + operation. Read more
Source§

impl Add<u8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: u8) -> Arbi

Performs the + operation. Read more
Source§

impl Add<u8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: u8) -> Self

Performs the + operation. Read more
Source§

impl Add<usize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: usize) -> Arbi

Performs the + operation. Read more
Source§

impl Add<usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

fn add(self, other: usize) -> Self

Performs the + operation. Read more
Source§

impl Add for Arbi

Implements self + rhs.

§Examples

use arbi::Arbi;
let a = Arbi::from(-1234567);
let b = Arbi::from(-123456);
let c = a + b;
assert_eq!(c, -1358023);

§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<'a> AddAssign<&'a Arbi> for Arbi

Implements self += &rhs.

§Examples

use arbi::Arbi;
let mut a = Arbi::from(-1234567);
let b = Arbi::from(-123456);
a += &b;
assert_eq!(a, -1358023);

§Complexity

\( O(n) \)

Source§

fn add_assign(&mut self, other: &'a Arbi)

Performs the += operation. Read more
Source§

impl AddAssign<&i128> for Arbi

Source§

fn add_assign(&mut self, other: &i128)

Performs the += operation. Read more
Source§

impl AddAssign<&i16> for Arbi

Source§

fn add_assign(&mut self, other: &i16)

Performs the += operation. Read more
Source§

impl AddAssign<&i32> for Arbi

Source§

fn add_assign(&mut self, other: &i32)

Performs the += operation. Read more
Source§

impl AddAssign<&i64> for Arbi

Source§

fn add_assign(&mut self, other: &i64)

Performs the += operation. Read more
Source§

impl AddAssign<&i8> for Arbi

Source§

fn add_assign(&mut self, other: &i8)

Performs the += operation. Read more
Source§

impl AddAssign<&isize> for Arbi

Source§

fn add_assign(&mut self, other: &isize)

Performs the += operation. Read more
Source§

impl AddAssign<&u128> for Arbi

Source§

fn add_assign(&mut self, other: &u128)

Performs the += operation. Read more
Source§

impl AddAssign<&u16> for Arbi

Source§

fn add_assign(&mut self, other: &u16)

Performs the += operation. Read more
Source§

impl AddAssign<&u32> for Arbi

Source§

fn add_assign(&mut self, other: &u32)

Performs the += operation. Read more
Source§

impl AddAssign<&u64> for Arbi

Source§

fn add_assign(&mut self, other: &u64)

Performs the += operation. Read more
Source§

impl AddAssign<&u8> for Arbi

Source§

fn add_assign(&mut self, other: &u8)

Performs the += operation. Read more
Source§

impl AddAssign<&usize> for Arbi

Source§

fn add_assign(&mut self, other: &usize)

Performs the += operation. Read more
Source§

impl AddAssign<i128> for Arbi

Source§

fn add_assign(&mut self, other: i128)

Performs the += operation. Read more
Source§

impl AddAssign<i16> for Arbi

Source§

fn add_assign(&mut self, other: i16)

Performs the += operation. Read more
Source§

impl AddAssign<i32> for Arbi

Source§

fn add_assign(&mut self, other: i32)

Performs the += operation. Read more
Source§

impl AddAssign<i64> for Arbi

Source§

fn add_assign(&mut self, other: i64)

Performs the += operation. Read more
Source§

impl AddAssign<i8> for Arbi

Source§

fn add_assign(&mut self, other: i8)

Performs the += operation. Read more
Source§

impl AddAssign<isize> for Arbi

Source§

fn add_assign(&mut self, other: isize)

Performs the += operation. Read more
Source§

impl AddAssign<u128> for Arbi

Source§

fn add_assign(&mut self, other: u128)

Performs the += operation. Read more
Source§

impl AddAssign<u16> for Arbi

Source§

fn add_assign(&mut self, other: u16)

Performs the += operation. Read more
Source§

impl AddAssign<u32> for Arbi

Source§

fn add_assign(&mut self, other: u32)

Performs the += operation. Read more
Source§

impl AddAssign<u64> for Arbi

Source§

fn add_assign(&mut self, other: u64)

Performs the += operation. Read more
Source§

impl AddAssign<u8> for Arbi

Source§

fn add_assign(&mut self, other: u8)

Performs the += operation. Read more
Source§

impl AddAssign<usize> for Arbi

Source§

fn add_assign(&mut self, other: usize)

Performs the += operation. Read more
Source§

impl AddAssign for Arbi

Implements self += rhs.

§Examples

use arbi::Arbi;
let mut a = Arbi::from(-1234567);
let b = Arbi::from(-123456);
a += b;
assert_eq!(a, -1358023);

§Complexity

\( O(n) \)

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

impl Assign<&Arbi> for Arbi

Copies the contents of the argument Arbi integer into this Arbi integer. If this Arbi integer already has enough capacity to represent value, then no memory allocation occurs.

Source§

fn assign(&mut self, value: &Arbi)

Assign a value of type T to an integer.
Source§

impl Assign<&f64> for Arbi

Source§

fn assign(&mut self, d: &f64)

Assign a floating-point value to an Arbi.

§Panic

Panics when attempting to convert a NaN or infinity.

§Note

In Rust, when casting a primitive float to a primitive integer type, NaNs are converted to 0 and values with large magnitudes and infinities are saturated to the maximum and minimum values of the integer type.

In contrast, this function panics in these scenarios.

Source§

impl Assign<&i128> for Arbi

Source§

fn assign(&mut self, value: &i128)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<&i16> for Arbi

Source§

fn assign(&mut self, value: &i16)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<&i32> for Arbi

Source§

fn assign(&mut self, value: &i32)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<&i64> for Arbi

Source§

fn assign(&mut self, value: &i64)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<&i8> for Arbi

Source§

fn assign(&mut self, value: &i8)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<&isize> for Arbi

Source§

fn assign(&mut self, value: &isize)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<&u128> for Arbi

Source§

fn assign(&mut self, value: &u128)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<&u16> for Arbi

Source§

fn assign(&mut self, value: &u16)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<&u32> for Arbi

Source§

fn assign(&mut self, value: &u32)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<&u64> for Arbi

Source§

fn assign(&mut self, value: &u64)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<&u8> for Arbi

Source§

fn assign(&mut self, value: &u8)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<&usize> for Arbi

Source§

fn assign(&mut self, value: &usize)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<f64> for Arbi

Source§

fn assign(&mut self, d: f64)

Assign a floating-point value to an Arbi.

§Panic

Panics when attempting to convert a NaN or infinity.

§Note

In Rust, when casting a primitive float to a primitive integer type, NaNs are converted to 0 and values with large magnitudes and infinities are saturated to the maximum and minimum values of the integer type.

In contrast, this function panics in these scenarios.

Source§

impl Assign<i128> for Arbi

Source§

fn assign(&mut self, value: i128)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<i16> for Arbi

Source§

fn assign(&mut self, value: i16)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<i32> for Arbi

Source§

fn assign(&mut self, value: i32)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<i64> for Arbi

Source§

fn assign(&mut self, value: i64)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<i8> for Arbi

Source§

fn assign(&mut self, value: i8)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<isize> for Arbi

Source§

fn assign(&mut self, value: isize)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<u128> for Arbi

Source§

fn assign(&mut self, value: u128)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<u16> for Arbi

Source§

fn assign(&mut self, value: u16)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<u32> for Arbi

Source§

fn assign(&mut self, value: u32)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<u64> for Arbi

Source§

fn assign(&mut self, value: u64)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<u8> for Arbi

Source§

fn assign(&mut self, value: u8)

Assign a builtin integral type value to an Arbi.

Source§

impl Assign<usize> for Arbi

Source§

fn assign(&mut self, value: usize)

Assign a builtin integral type value to an Arbi.

Source§

impl<'a> BitAnd<&'a Arbi> for &Arbi

Mathematically, given two integers \( x, y \) with coefficients \( x_{i}, y_{i} \) of their binary representation, the result of \( x \; \& \; y \) (bitwise AND) is an integer \( r \) with base-2 coefficients \( r_{i} \) such that \[ r_{i} = 1 \Longleftrightarrow x_{i} = 1 \wedge y_{i} = 1 \]

Source§

type Output = Arbi

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &'a Arbi) -> Self::Output

Performs the & operation. Read more
Source§

impl<'a> BitAnd<&'a Arbi> for Arbi

See BitAnd for the mathematical semantics.

Source§

type Output = Arbi

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &'a Self) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd for Arbi

See BitAnd for the mathematical semantics.

Source§

type Output = Arbi

The resulting type after applying the & operator.
Source§

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

Performs the & operation. Read more
Source§

impl<'a> BitAndAssign<&'a Arbi> for Arbi

See BitAnd for the mathematical semantics.

Source§

fn bitand_assign(&mut self, rhs: &'a Self)

Performs the &= operation. Read more
Source§

impl BitAndAssign for Arbi

See BitAnd for the mathematical semantics.

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl<'a> BitOr<&'a Arbi> for &Arbi

Mathematically, given two integers \( x, y \) with coefficients \( x_{i}, y_{i} \) of their binary representation, the result of \( x \; | \; y \) (bitwise inclusive OR) is an integer \( r \) with base-2 coefficients \( r_{i} \) such that \[ r_{i} = 1 \Longleftrightarrow x_{i} = 1 \lor y_{i} = 1 \]

Source§

type Output = Arbi

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &'a Arbi) -> Self::Output

Performs the | operation. Read more
Source§

impl<'a> BitOr<&'a Arbi> for Arbi

See BitOr for the mathematical semantics.

Source§

type Output = Arbi

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &'a Self) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr for Arbi

See BitOr for the mathematical semantics.

Source§

type Output = Arbi

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl<'a> BitOrAssign<&'a Arbi> for Arbi

See BitOr for the mathematical semantics.

Source§

fn bitor_assign(&mut self, rhs: &'a Self)

Performs the |= operation. Read more
Source§

impl BitOrAssign for Arbi

See BitOr for the mathematical semantics.

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl<'a> BitXor<&'a Arbi> for &Arbi

Mathematically, given two integers \( x, y \) with coefficients \( x_{i}, y_{i} \) of their binary representation, the result of \( x \; ^\wedge \; y \) (bitwise exclusive OR) is an integer \( r \) with base-2 coefficients \( r_{i} \) such that \[ r_{i} = 1 \Longleftrightarrow (x_{i} = 1 \wedge y_{i} = 0) \lor (x_{i} = 0 \wedge y_{i} = 1) \]

Source§

type Output = Arbi

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &'a Arbi) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<'a> BitXor<&'a Arbi> for Arbi

See BitXor for the mathematical semantics.

Source§

type Output = Arbi

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &'a Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor for Arbi

See BitXor for the mathematical semantics.

Source§

type Output = Arbi

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<'a> BitXorAssign<&'a Arbi> for Arbi

See BitXor for the mathematical semantics.

Source§

fn bitxor_assign(&mut self, rhs: &'a Self)

Performs the ^= operation. Read more
Source§

impl BitXorAssign for Arbi

See BitXor for the mathematical semantics.

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl Clone for Arbi

Source§

fn clone(&self) -> Arbi

Returns a copy 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 Debug for Arbi

Source§

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

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

impl Default for Arbi

Source§

fn default() -> Arbi

Returns the “default value” for a type. Read more
Source§

impl Display for Arbi

Outputs the base-10 (decimal) representation of an Arbi integer.

§Examples

use arbi::Arbi;

let a = Arbi::from(12345);
assert_eq!(format!("{}", a), "12345");
Source§

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

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

impl<'a> Div<&'a Arbi> for &Arbi

See the div() method.

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &'a Arbi) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &i128

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &i16

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &i32

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &i64

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &i8

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &isize

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &u128

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &u16

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &u32

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &u64

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &u8

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for &usize

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl<'a> Div<&'a Arbi> for Arbi

See the div() method.

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &'a Arbi) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&Arbi> for i128

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for i16

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for i32

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for i64

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for i8

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for isize

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for u128

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for u16

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for u32

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for u64

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for u8

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Arbi> for usize

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&i128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &i128) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&i128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &i128) -> Self

Performs the / operation. Read more
Source§

impl Div<&i16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &i16) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&i16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &i16) -> Self

Performs the / operation. Read more
Source§

impl Div<&i32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &i32) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &i32) -> Self

Performs the / operation. Read more
Source§

impl Div<&i64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &i64) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&i64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &i64) -> Self

Performs the / operation. Read more
Source§

impl Div<&i8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &i8) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&i8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &i8) -> Self

Performs the / operation. Read more
Source§

impl Div<&isize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &isize) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&isize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &isize) -> Self

Performs the / operation. Read more
Source§

impl Div<&u128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &u128) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &u128) -> Self

Performs the / operation. Read more
Source§

impl Div<&u16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &u16) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&u16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &u16) -> Self

Performs the / operation. Read more
Source§

impl Div<&u32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &u32) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &u32) -> Self

Performs the / operation. Read more
Source§

impl Div<&u64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &u64) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&u64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &u64) -> Self

Performs the / operation. Read more
Source§

impl Div<&u8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &u8) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&u8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &u8) -> Self

Performs the / operation. Read more
Source§

impl Div<&usize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &usize) -> Arbi

Performs the / operation. Read more
Source§

impl Div<&usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: &usize) -> Self

Performs the / operation. Read more
Source§

impl Div<Arbi> for &i128

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for &i16

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for &i32

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for &i64

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for &i8

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for &isize

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for &u128

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for &u16

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for &u32

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for &u64

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for &u8

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for &usize

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for i128

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for i16

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for i32

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for i64

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for i8

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for isize

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for u128

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for u16

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for u32

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for u64

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for u8

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Arbi> for usize

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: Arbi) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: i128) -> Arbi

Performs the / operation. Read more
Source§

impl Div<i128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: i128) -> Self

Performs the / operation. Read more
Source§

impl Div<i16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: i16) -> Arbi

Performs the / operation. Read more
Source§

impl Div<i16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: i16) -> Self

Performs the / operation. Read more
Source§

impl Div<i32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: i32) -> Arbi

Performs the / operation. Read more
Source§

impl Div<i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: i32) -> Self

Performs the / operation. Read more
Source§

impl Div<i64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: i64) -> Arbi

Performs the / operation. Read more
Source§

impl Div<i64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: i64) -> Self

Performs the / operation. Read more
Source§

impl Div<i8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: i8) -> Arbi

Performs the / operation. Read more
Source§

impl Div<i8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: i8) -> Self

Performs the / operation. Read more
Source§

impl Div<isize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: isize) -> Arbi

Performs the / operation. Read more
Source§

impl Div<isize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: isize) -> Self

Performs the / operation. Read more
Source§

impl Div<u128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: u128) -> Arbi

Performs the / operation. Read more
Source§

impl Div<u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: u128) -> Self

Performs the / operation. Read more
Source§

impl Div<u16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: u16) -> Arbi

Performs the / operation. Read more
Source§

impl Div<u16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: u16) -> Self

Performs the / operation. Read more
Source§

impl Div<u32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: u32) -> Arbi

Performs the / operation. Read more
Source§

impl Div<u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: u32) -> Self

Performs the / operation. Read more
Source§

impl Div<u64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: u64) -> Arbi

Performs the / operation. Read more
Source§

impl Div<u64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: u64) -> Self

Performs the / operation. Read more
Source§

impl Div<u8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: u8) -> Arbi

Performs the / operation. Read more
Source§

impl Div<u8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: u8) -> Self

Performs the / operation. Read more
Source§

impl Div<usize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: usize) -> Arbi

Performs the / operation. Read more
Source§

impl Div<usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, other: usize) -> Self

Performs the / operation. Read more
Source§

impl Div for Arbi

See the div() method.

Source§

type Output = Arbi

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Arbi) -> Arbi

Performs the / operation. Read more
Source§

impl<'a> DivAssign<&'a Arbi> for Arbi

See the div() method.

Source§

fn div_assign(&mut self, rhs: &'a Arbi)

Performs the /= operation. Read more
Source§

impl DivAssign<&i128> for Arbi

Source§

fn div_assign(&mut self, other: &i128)

Performs the /= operation. Read more
Source§

impl DivAssign<&i16> for Arbi

Source§

fn div_assign(&mut self, other: &i16)

Performs the /= operation. Read more
Source§

impl DivAssign<&i32> for Arbi

Source§

fn div_assign(&mut self, other: &i32)

Performs the /= operation. Read more
Source§

impl DivAssign<&i64> for Arbi

Source§

fn div_assign(&mut self, other: &i64)

Performs the /= operation. Read more
Source§

impl DivAssign<&i8> for Arbi

Source§

fn div_assign(&mut self, other: &i8)

Performs the /= operation. Read more
Source§

impl DivAssign<&isize> for Arbi

Source§

fn div_assign(&mut self, other: &isize)

Performs the /= operation. Read more
Source§

impl DivAssign<&u128> for Arbi

Source§

fn div_assign(&mut self, other: &u128)

Performs the /= operation. Read more
Source§

impl DivAssign<&u16> for Arbi

Source§

fn div_assign(&mut self, other: &u16)

Performs the /= operation. Read more
Source§

impl DivAssign<&u32> for Arbi

Source§

fn div_assign(&mut self, other: &u32)

Performs the /= operation. Read more
Source§

impl DivAssign<&u64> for Arbi

Source§

fn div_assign(&mut self, other: &u64)

Performs the /= operation. Read more
Source§

impl DivAssign<&u8> for Arbi

Source§

fn div_assign(&mut self, other: &u8)

Performs the /= operation. Read more
Source§

impl DivAssign<&usize> for Arbi

Source§

fn div_assign(&mut self, other: &usize)

Performs the /= operation. Read more
Source§

impl DivAssign<i128> for Arbi

Source§

fn div_assign(&mut self, other: i128)

Performs the /= operation. Read more
Source§

impl DivAssign<i16> for Arbi

Source§

fn div_assign(&mut self, other: i16)

Performs the /= operation. Read more
Source§

impl DivAssign<i32> for Arbi

Source§

fn div_assign(&mut self, other: i32)

Performs the /= operation. Read more
Source§

impl DivAssign<i64> for Arbi

Source§

fn div_assign(&mut self, other: i64)

Performs the /= operation. Read more
Source§

impl DivAssign<i8> for Arbi

Source§

fn div_assign(&mut self, other: i8)

Performs the /= operation. Read more
Source§

impl DivAssign<isize> for Arbi

Source§

fn div_assign(&mut self, other: isize)

Performs the /= operation. Read more
Source§

impl DivAssign<u128> for Arbi

Source§

fn div_assign(&mut self, other: u128)

Performs the /= operation. Read more
Source§

impl DivAssign<u16> for Arbi

Source§

fn div_assign(&mut self, other: u16)

Performs the /= operation. Read more
Source§

impl DivAssign<u32> for Arbi

Source§

fn div_assign(&mut self, other: u32)

Performs the /= operation. Read more
Source§

impl DivAssign<u64> for Arbi

Source§

fn div_assign(&mut self, other: u64)

Performs the /= operation. Read more
Source§

impl DivAssign<u8> for Arbi

Source§

fn div_assign(&mut self, other: u8)

Performs the /= operation. Read more
Source§

impl DivAssign<usize> for Arbi

Source§

fn div_assign(&mut self, other: usize)

Performs the /= operation. Read more
Source§

impl DivAssign for Arbi

See the div() method.

Source§

fn div_assign(&mut self, rhs: Arbi)

Performs the /= operation. Read more
Source§

impl From<&Arbi> for i128

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&Arbi> for i16

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&Arbi> for i32

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&Arbi> for i64

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&Arbi> for i8

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&Arbi> for isize

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&Arbi> for u128

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&Arbi> for u16

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&Arbi> for u32

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&Arbi> for u64

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&Arbi> for u8

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&Arbi> for usize

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let b = u32::from(&a);
assert_eq!(b, 123456789);
let c = u16::from(&a);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: &Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<&i128> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &i128) -> Self

Converts to this type from the input type.
Source§

impl From<&i16> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &i16) -> Self

Converts to this type from the input type.
Source§

impl From<&i32> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &i32) -> Self

Converts to this type from the input type.
Source§

impl From<&i64> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &i64) -> Self

Converts to this type from the input type.
Source§

impl From<&i8> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &i8) -> Self

Converts to this type from the input type.
Source§

impl From<&isize> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &isize) -> Self

Converts to this type from the input type.
Source§

impl From<&u128> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &u128) -> Self

Converts to this type from the input type.
Source§

impl From<&u16> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &u16) -> Self

Converts to this type from the input type.
Source§

impl From<&u32> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &u32) -> Self

Converts to this type from the input type.
Source§

impl From<&u64> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &u64) -> Self

Converts to this type from the input type.
Source§

impl From<&u8> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &u8) -> Self

Converts to this type from the input type.
Source§

impl From<&usize> for Arbi

Construct an Arbi integer from this primitive integer type value.

See impl From<i32> for Arbi.

Source§

fn from(value: &usize) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for i128

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for i16

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for i32

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for i64

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for i8

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for isize

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for u128

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for u16

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for u32

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for u64

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for u8

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<Arbi> for usize

Equivalent to converting an Arbi integer to this type using its corresponding wrapping_to_*() method. For example, see Arbi::wrapping_to_u32().

Please note that From<&Arbi> is also implemented. See, for example, impl From<&Arbi> for i32.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789); // 0b111010110111100110100010101
let a_clone = a.clone();
let b = u32::from(a);
assert_eq!(b, 123456789);
let c = u16::from(a_clone);
assert_eq!(c, 52501); // 0b1100110100010101
Source§

fn from(arbi: Arbi) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Arbi

Construct an Arbi integer from a floating-point value.

§Panic

Panics when attempting to convert a NaN or infinity.

§Note

In Rust, when casting a primitive float to a primitive integer type, NaNs are converted to 0 and values with large magnitudes and infinities are saturated to the maximum and minimum values of the integer type.

In contrast, this function panics when NaN or infinity is encountered.

Otherwise, the semantics of this function are consistent with Rust’s built-in behavior for casting floats to integers.

§Examples

use arbi::Arbi;

let a = Arbi::from(12345.6789);
assert_eq!(a, 12345);
assert_eq!(a, 12345.6789 as i32)

Attempting to convert infinity panics.

use arbi::Arbi;

let a = Arbi::from(f64::INFINITY);

Attempting to convert NaN panics.

use arbi::Arbi;

let b = Arbi::from(f64::NAN);
§Complexity

\( O(1) \)

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: i128) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<isize> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: isize) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: u128) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for Arbi

Construct an Arbi integer from this primitive integer type value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u128::MAX);
assert_eq!(a, u128::MAX);

let b = Arbi::from(i128::MIN);
assert_eq!(b, i128::MIN);

// Also works with references
let c = Arbi::from(&i128::MIN);
assert_eq!(c, i128::MIN);
§Complexity

\( O(1) \)

Source§

fn from(value: usize) -> Self

Converts to this type from the input type.
Source§

impl FromStr for Arbi

Source§

fn from_str(src: &str) -> Result<Self, Self::Err>

Uses Arbi::from_str_radix() with base 10.

§Examples
use arbi::Arbi;
use core::str::FromStr;

let a = Arbi::from_str("-987654321").unwrap();
assert_eq!(a, -987654321);

let b = "123456789".parse::<Arbi>().unwrap();
assert_eq!(b, 123456789);
Source§

type Err = ParseError

The associated error which can be returned from parsing.
Source§

impl<'b> Mul<&'b Arbi> for &Arbi

Multiply an Arbi integer by another Arbi integer.

§Examples

use arbi::Arbi;

let mut a = Arbi::from(i16::MIN);
let mut b = a.clone();

a = &a * &b;
assert_eq!(a, (i16::MIN as i128).pow(2));

a = a * &b;
assert_eq!(a, (i16::MIN as i128).pow(3));

a *= &b;
assert_eq!(a, (i16::MIN as i128).pow(4));

a *= b;
assert_eq!(a, (i16::MIN as i128).pow(5));

a = &a * &a;
assert_eq!(
    a,
    Arbi::from_str_radix("40000000000000000000000000000000000000", 16)
        .unwrap()
);
§Complexity

\( O(n^{\log_{2}(3)}) \approx O(n^{1.58}) \)

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'b Arbi) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &i128

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &i16

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &i32

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &i64

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &i8

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &isize

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &u128

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &u16

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &u32

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &u64

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &u8

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for &usize

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl<'a> Mul<&'a Arbi> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'a Arbi) -> Self

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for i128

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for i16

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for i32

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for i64

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for i8

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for isize

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for u128

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for u16

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for u32

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for u64

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for u8

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&Arbi> for usize

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&i128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &i128) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&i128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &i128) -> Self

Performs the * operation. Read more
Source§

impl Mul<&i16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &i16) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&i16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &i16) -> Self

Performs the * operation. Read more
Source§

impl Mul<&i32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &i32) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &i32) -> Self

Performs the * operation. Read more
Source§

impl Mul<&i64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &i64) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&i64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &i64) -> Self

Performs the * operation. Read more
Source§

impl Mul<&i8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &i8) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&i8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &i8) -> Self

Performs the * operation. Read more
Source§

impl Mul<&isize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &isize) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&isize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &isize) -> Self

Performs the * operation. Read more
Source§

impl Mul<&u128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u128) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u128) -> Self

Performs the * operation. Read more
Source§

impl Mul<&u16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u16) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&u16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u16) -> Self

Performs the * operation. Read more
Source§

impl Mul<&u32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u32) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u32) -> Self

Performs the * operation. Read more
Source§

impl Mul<&u64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u64) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&u64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u64) -> Self

Performs the * operation. Read more
Source§

impl Mul<&u8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u8) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&u8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u8) -> Self

Performs the * operation. Read more
Source§

impl Mul<&usize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &usize) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<&usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: &usize) -> Self

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &i128

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &i16

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &i32

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &i64

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &i8

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &isize

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &u128

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &u16

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &u32

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &u64

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &u8

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for &usize

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for i128

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for i16

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for i32

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for i64

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for i8

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for isize

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for u128

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for u16

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for u32

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for u64

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for u8

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<Arbi> for usize

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: Arbi) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<i128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: i128) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<i128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: i128) -> Self

Performs the * operation. Read more
Source§

impl Mul<i16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: i16) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<i16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: i16) -> Self

Performs the * operation. Read more
Source§

impl Mul<i32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: i32) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: i32) -> Self

Performs the * operation. Read more
Source§

impl Mul<i64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: i64) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<i64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: i64) -> Self

Performs the * operation. Read more
Source§

impl Mul<i8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: i8) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<i8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: i8) -> Self

Performs the * operation. Read more
Source§

impl Mul<isize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: isize) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<isize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: isize) -> Self

Performs the * operation. Read more
Source§

impl Mul<u128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: u128) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: u128) -> Self

Performs the * operation. Read more
Source§

impl Mul<u16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: u16) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<u16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: u16) -> Self

Performs the * operation. Read more
Source§

impl Mul<u32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: u32) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: u32) -> Self

Performs the * operation. Read more
Source§

impl Mul<u64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: u64) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<u64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: u64) -> Self

Performs the * operation. Read more
Source§

impl Mul<u8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: u8) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<u8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: u8) -> Self

Performs the * operation. Read more
Source§

impl Mul<usize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: usize) -> Arbi

Performs the * operation. Read more
Source§

impl Mul<usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, other: usize) -> Self

Performs the * operation. Read more
Source§

impl Mul for Arbi

Source§

type Output = Arbi

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign<&Arbi> for Arbi

Source§

fn mul_assign(&mut self, rhs: &Arbi)

Performs the *= operation. Read more
Source§

impl MulAssign<&i128> for Arbi

Source§

fn mul_assign(&mut self, other: &i128)

Performs the *= operation. Read more
Source§

impl MulAssign<&i16> for Arbi

Source§

fn mul_assign(&mut self, other: &i16)

Performs the *= operation. Read more
Source§

impl MulAssign<&i32> for Arbi

Source§

fn mul_assign(&mut self, other: &i32)

Performs the *= operation. Read more
Source§

impl MulAssign<&i64> for Arbi

Source§

fn mul_assign(&mut self, other: &i64)

Performs the *= operation. Read more
Source§

impl MulAssign<&i8> for Arbi

Source§

fn mul_assign(&mut self, other: &i8)

Performs the *= operation. Read more
Source§

impl MulAssign<&isize> for Arbi

Source§

fn mul_assign(&mut self, other: &isize)

Performs the *= operation. Read more
Source§

impl MulAssign<&u128> for Arbi

Source§

fn mul_assign(&mut self, other: &u128)

Performs the *= operation. Read more
Source§

impl MulAssign<&u16> for Arbi

Source§

fn mul_assign(&mut self, other: &u16)

Performs the *= operation. Read more
Source§

impl MulAssign<&u32> for Arbi

Source§

fn mul_assign(&mut self, other: &u32)

Performs the *= operation. Read more
Source§

impl MulAssign<&u64> for Arbi

Source§

fn mul_assign(&mut self, other: &u64)

Performs the *= operation. Read more
Source§

impl MulAssign<&u8> for Arbi

Source§

fn mul_assign(&mut self, other: &u8)

Performs the *= operation. Read more
Source§

impl MulAssign<&usize> for Arbi

Source§

fn mul_assign(&mut self, other: &usize)

Performs the *= operation. Read more
Source§

impl MulAssign<i128> for Arbi

Source§

fn mul_assign(&mut self, other: i128)

Performs the *= operation. Read more
Source§

impl MulAssign<i16> for Arbi

Source§

fn mul_assign(&mut self, other: i16)

Performs the *= operation. Read more
Source§

impl MulAssign<i32> for Arbi

Source§

fn mul_assign(&mut self, other: i32)

Performs the *= operation. Read more
Source§

impl MulAssign<i64> for Arbi

Source§

fn mul_assign(&mut self, other: i64)

Performs the *= operation. Read more
Source§

impl MulAssign<i8> for Arbi

Source§

fn mul_assign(&mut self, other: i8)

Performs the *= operation. Read more
Source§

impl MulAssign<isize> for Arbi

Source§

fn mul_assign(&mut self, other: isize)

Performs the *= operation. Read more
Source§

impl MulAssign<u128> for Arbi

Source§

fn mul_assign(&mut self, other: u128)

Performs the *= operation. Read more
Source§

impl MulAssign<u16> for Arbi

Source§

fn mul_assign(&mut self, other: u16)

Performs the *= operation. Read more
Source§

impl MulAssign<u32> for Arbi

Source§

fn mul_assign(&mut self, other: u32)

Performs the *= operation. Read more
Source§

impl MulAssign<u64> for Arbi

Source§

fn mul_assign(&mut self, other: u64)

Performs the *= operation. Read more
Source§

impl MulAssign<u8> for Arbi

Source§

fn mul_assign(&mut self, other: u8)

Performs the *= operation. Read more
Source§

impl MulAssign<usize> for Arbi

Source§

fn mul_assign(&mut self, other: usize)

Performs the *= operation. Read more
Source§

impl MulAssign for Arbi

Source§

fn mul_assign(&mut self, rhs: Arbi)

Performs the *= operation. Read more
Source§

impl Neg for &Arbi

Return a new Arbi integer representing self negated.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789);
let b = -&a; // Cloning occurs
assert_eq!(b, -123456789);

§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn neg(self) -> Arbi

Performs the unary - operation. Read more
Source§

impl Neg for Arbi

Negate self in-place and return self.

§Examples

use arbi::Arbi;
let a = Arbi::from(123456789);
let b = -a;
assert_eq!(b, -123456789);

§Complexity

\( O(1) \)

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl Not for &Arbi

Unary complement operator. Return a new integer representing the ones’ complement of this integer.

Currently, this involves cloning the referenced Arbi integer.

§Example

use arbi::{Arbi, Assign};

let mut a = Arbi::zero();
a = !&a;
assert_eq!(a, -1);
assert_eq!(a, !0);

a.assign(u16::MAX);
a = !&a;
assert_eq!(a, -65536);
assert_eq!(a, !(u16::MAX as i32));
§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl Not for Arbi

Unary complement operator. Return the ones’ complement of this integer.

This is done in-place, using the moved-in value.

§Example

use arbi::{Arbi, Assign};

let mut a = Arbi::zero();
a = !a; // in-place
assert_eq!(a, -1);
assert_eq!(a, !0);

a.assign(u16::MAX);
a = !a; // in-place
assert_eq!(a, -65536);
assert_eq!(a, !(u16::MAX as i32));
§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl Ord for Arbi

Source§

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

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq<Arbi> for f64

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for i128

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for i16

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for i32

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for i64

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for i8

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for isize

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for u128

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for u16

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for u32

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for u64

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for u8

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<Arbi> for usize

Test if this primitive integer value is equal to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(u64::MAX, a);
assert_ne!(u64::MAX - 1, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &Arbi) -> 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 PartialEq<f64> for &Arbi

Source§

fn eq(&self, other: &f64) -> 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 PartialEq<f64> for Arbi

Test if this Arbi integer is equal to a floating-point value.

See also PartialOrd<f64> for Arbi for a description of the semantics of comparing an Arbi to a floating-point value.

§Examples

use arbi::Arbi;

let a = Arbi::from(f64::MAX);

assert_eq!(a, f64::MAX);
assert_ne!(a, f64::MIN);

// Reverse also implemented
assert_eq!(f64::MAX, a);
assert_ne!(f64::MIN, a);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &f64) -> 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 PartialEq<i128> for &Arbi

Source§

fn eq(&self, other: &i128) -> 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 PartialEq<i128> for &mut Arbi

Source§

fn eq(&self, other: &i128) -> 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 PartialEq<i128> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &i128) -> 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 PartialEq<i16> for &Arbi

Source§

fn eq(&self, other: &i16) -> 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 PartialEq<i16> for &mut Arbi

Source§

fn eq(&self, other: &i16) -> 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 PartialEq<i16> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &i16) -> 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 PartialEq<i32> for &Arbi

Source§

fn eq(&self, other: &i32) -> 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 PartialEq<i32> for &mut Arbi

Source§

fn eq(&self, other: &i32) -> 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 PartialEq<i32> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &i32) -> 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 PartialEq<i64> for &Arbi

Source§

fn eq(&self, other: &i64) -> 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 PartialEq<i64> for &mut Arbi

Source§

fn eq(&self, other: &i64) -> 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 PartialEq<i64> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &i64) -> 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 PartialEq<i8> for &Arbi

Source§

fn eq(&self, other: &i8) -> 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 PartialEq<i8> for &mut Arbi

Source§

fn eq(&self, other: &i8) -> 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 PartialEq<i8> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &i8) -> 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 PartialEq<isize> for &Arbi

Source§

fn eq(&self, other: &isize) -> 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 PartialEq<isize> for &mut Arbi

Source§

fn eq(&self, other: &isize) -> 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 PartialEq<isize> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &isize) -> 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 PartialEq<u128> for &Arbi

Source§

fn eq(&self, other: &u128) -> 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 PartialEq<u128> for &mut Arbi

Source§

fn eq(&self, other: &u128) -> 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 PartialEq<u128> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &u128) -> 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 PartialEq<u16> for &Arbi

Source§

fn eq(&self, other: &u16) -> 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 PartialEq<u16> for &mut Arbi

Source§

fn eq(&self, other: &u16) -> 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 PartialEq<u16> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &u16) -> 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 PartialEq<u32> for &Arbi

Source§

fn eq(&self, other: &u32) -> 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 PartialEq<u32> for &mut Arbi

Source§

fn eq(&self, other: &u32) -> 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 PartialEq<u32> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &u32) -> 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 PartialEq<u64> for &Arbi

Source§

fn eq(&self, other: &u64) -> 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 PartialEq<u64> for &mut Arbi

Source§

fn eq(&self, other: &u64) -> 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 PartialEq<u64> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &u64) -> 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 PartialEq<u8> for &Arbi

Source§

fn eq(&self, other: &u8) -> 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 PartialEq<u8> for &mut Arbi

Source§

fn eq(&self, other: &u8) -> 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 PartialEq<u8> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &u8) -> 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 PartialEq<usize> for &Arbi

Source§

fn eq(&self, other: &usize) -> 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 PartialEq<usize> for &mut Arbi

Source§

fn eq(&self, other: &usize) -> 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 PartialEq<usize> for Arbi

Test if this Arbi integer is equal to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert_eq!(a, u64::MAX);
assert_ne!(a, u64::MAX - 1);
§Complexity

\( O(1) \)

Source§

fn eq(&self, other: &usize) -> 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 PartialEq for Arbi

Source§

fn eq(&self, other: &Self) -> 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 PartialOrd<Arbi> for f64

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for i128

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for i16

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for i32

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for i64

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for i8

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for isize

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for u128

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for u16

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for u32

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for u64

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for u8

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<Arbi> for usize

Compare the value of this primitive integer value to an Arbi integer.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(0 < a);
assert!(u128::MAX > a);
assert!(0 <= a);
assert!(u128::MAX >= a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &Arbi) -> 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 PartialOrd<f64> for &Arbi

Source§

fn partial_cmp(&self, other: &f64) -> 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 PartialOrd<f64> for Arbi

Compare this Arbi integer to a floating-point value.

These comparisons are designed to be consistent with IEEE 754, handling special cases like NaNs and infinities.

NaN:

  • Operators ==, <, <=, >, and >= return false when comparing with NaN.
  • Operator != returns true when comparing with NaN.

Infinities:

  • Positive infinity is treated as greater than any Arbi number.
  • Negative infinity is treated as less than any Arbi number.

§Examples

use arbi::Arbi;

let a = Arbi::from(987654321.5);
assert_eq!(a, 987654321.0);

assert!(a >= 987654321.0);
assert!(a <= 987654321.0);
assert!(a > 0.0);
assert!(a < u64::MAX);

// Reverse also implemented
assert!(987654321.0 <= a);
assert!(987654321.0 >= a);
assert!(0.0 < a);
assert!(u64::MAX > a);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &f64) -> 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 PartialOrd<i128> for &Arbi

Source§

fn partial_cmp(&self, other: &i128) -> 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 PartialOrd<i128> for &mut Arbi

Source§

fn partial_cmp(&self, other: &i128) -> 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 PartialOrd<i128> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &i128) -> 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 PartialOrd<i16> for &Arbi

Source§

fn partial_cmp(&self, other: &i16) -> 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 PartialOrd<i16> for &mut Arbi

Source§

fn partial_cmp(&self, other: &i16) -> 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 PartialOrd<i16> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &i16) -> 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 PartialOrd<i32> for &Arbi

Source§

fn partial_cmp(&self, other: &i32) -> 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 PartialOrd<i32> for &mut Arbi

Source§

fn partial_cmp(&self, other: &i32) -> 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 PartialOrd<i32> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &i32) -> 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 PartialOrd<i64> for &Arbi

Source§

fn partial_cmp(&self, other: &i64) -> 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 PartialOrd<i64> for &mut Arbi

Source§

fn partial_cmp(&self, other: &i64) -> 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 PartialOrd<i64> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &i64) -> 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 PartialOrd<i8> for &Arbi

Source§

fn partial_cmp(&self, other: &i8) -> 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 PartialOrd<i8> for &mut Arbi

Source§

fn partial_cmp(&self, other: &i8) -> 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 PartialOrd<i8> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &i8) -> 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 PartialOrd<isize> for &Arbi

Source§

fn partial_cmp(&self, other: &isize) -> 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 PartialOrd<isize> for &mut Arbi

Source§

fn partial_cmp(&self, other: &isize) -> 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 PartialOrd<isize> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &isize) -> 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 PartialOrd<u128> for &Arbi

Source§

fn partial_cmp(&self, other: &u128) -> 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 PartialOrd<u128> for &mut Arbi

Source§

fn partial_cmp(&self, other: &u128) -> 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 PartialOrd<u128> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &u128) -> 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 PartialOrd<u16> for &Arbi

Source§

fn partial_cmp(&self, other: &u16) -> 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 PartialOrd<u16> for &mut Arbi

Source§

fn partial_cmp(&self, other: &u16) -> 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 PartialOrd<u16> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &u16) -> 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 PartialOrd<u32> for &Arbi

Source§

fn partial_cmp(&self, other: &u32) -> 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 PartialOrd<u32> for &mut Arbi

Source§

fn partial_cmp(&self, other: &u32) -> 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 PartialOrd<u32> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &u32) -> 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 PartialOrd<u64> for &Arbi

Source§

fn partial_cmp(&self, other: &u64) -> 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 PartialOrd<u64> for &mut Arbi

Source§

fn partial_cmp(&self, other: &u64) -> 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 PartialOrd<u64> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &u64) -> 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 PartialOrd<u8> for &Arbi

Source§

fn partial_cmp(&self, other: &u8) -> 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 PartialOrd<u8> for &mut Arbi

Source§

fn partial_cmp(&self, other: &u8) -> 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 PartialOrd<u8> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &u8) -> 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 PartialOrd<usize> for &Arbi

Source§

fn partial_cmp(&self, other: &usize) -> 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 PartialOrd<usize> for &mut Arbi

Source§

fn partial_cmp(&self, other: &usize) -> 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 PartialOrd<usize> for Arbi

Compare the value of this Arbi integer to a primitive integer value.

This is implemented for all primitive integer types.

§Examples

use arbi::Arbi;

let a = Arbi::from(u64::MAX);
assert!(a > 0);
assert!(a < u128::MAX);
assert!(a >= 0);
assert!(a <= u128::MAX);
§Complexity

\( O(1) \)

Source§

fn partial_cmp(&self, other: &usize) -> 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 PartialOrd for Arbi

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<'a> Pow<&'a Arbi> for &Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: &'a Arbi) -> Arbi

Return self to the power exponent.
Source§

impl<'a> Pow<&'a Arbi> for Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: &'a Arbi) -> Arbi

Return self to the power exponent.
Source§

impl Pow<&u128> for &Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: &u128) -> Arbi

Return self to the power exponent.
Source§

impl Pow<&u128> for Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: &u128) -> Arbi

Return self to the power exponent.
Source§

impl<'a> Pow<&'a usize> for &Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: &'a usize) -> Arbi

Return self to the power exponent.
Source§

impl<'a> Pow<&'a usize> for Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: &'a usize) -> Arbi

Return self to the power exponent.
Source§

impl Pow<Arbi> for &Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: Arbi) -> Arbi

Return self to the power exponent.
Source§

impl Pow<Arbi> for Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: Arbi) -> Arbi

Return self to the power exponent.
Source§

impl Pow<u128> for &Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: u128) -> Arbi

Return self to the power exponent.
Source§

impl Pow<u128> for Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: u128) -> Arbi

Return self to the power exponent.
Source§

impl Pow<usize> for &Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: usize) -> Arbi

Return self to the power exponent.
Source§

impl Pow<usize> for Arbi

Source§

type Output = Arbi

The return type of pow().
Source§

fn pow(self, exp: usize) -> Arbi

Return self to the power exponent.
Source§

impl<'a> Rem<&'a Arbi> for &Arbi

See the div() method.

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &'a Arbi) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &i128

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &i16

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &i32

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &i64

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &i8

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &isize

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &u128

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &u16

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &u32

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &u64

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &u8

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for &usize

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl<'a> Rem<&'a Arbi> for Arbi

See the div() method.

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &'a Arbi) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for i128

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for i16

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for i32

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for i64

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for i8

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for isize

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for u128

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for u16

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for u32

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for u64

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for u8

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Arbi> for usize

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&i128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &i128) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&i128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &i128) -> Self

Performs the % operation. Read more
Source§

impl Rem<&i16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &i16) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&i16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &i16) -> Self

Performs the % operation. Read more
Source§

impl Rem<&i32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &i32) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &i32) -> Self

Performs the % operation. Read more
Source§

impl Rem<&i64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &i64) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&i64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &i64) -> Self

Performs the % operation. Read more
Source§

impl Rem<&i8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &i8) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&i8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &i8) -> Self

Performs the % operation. Read more
Source§

impl Rem<&isize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &isize) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&isize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &isize) -> Self

Performs the % operation. Read more
Source§

impl Rem<&u128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &u128) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &u128) -> Self

Performs the % operation. Read more
Source§

impl Rem<&u16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &u16) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&u16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &u16) -> Self

Performs the % operation. Read more
Source§

impl Rem<&u32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &u32) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &u32) -> Self

Performs the % operation. Read more
Source§

impl Rem<&u64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &u64) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&u64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &u64) -> Self

Performs the % operation. Read more
Source§

impl Rem<&u8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &u8) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&u8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &u8) -> Self

Performs the % operation. Read more
Source§

impl Rem<&usize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &usize) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<&usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: &usize) -> Self

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &i128

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &i16

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &i32

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &i64

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &i8

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &isize

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &u128

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &u16

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &u32

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &u64

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &u8

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for &usize

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for i128

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for i16

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for i32

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for i64

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for i8

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for isize

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for u128

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for u16

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for u32

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for u64

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for u8

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Arbi> for usize

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: Arbi) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<i128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: i128) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<i128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: i128) -> Self

Performs the % operation. Read more
Source§

impl Rem<i16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: i16) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<i16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: i16) -> Self

Performs the % operation. Read more
Source§

impl Rem<i32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: i32) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: i32) -> Self

Performs the % operation. Read more
Source§

impl Rem<i64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: i64) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<i64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: i64) -> Self

Performs the % operation. Read more
Source§

impl Rem<i8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: i8) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<i8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: i8) -> Self

Performs the % operation. Read more
Source§

impl Rem<isize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: isize) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<isize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: isize) -> Self

Performs the % operation. Read more
Source§

impl Rem<u128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: u128) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: u128) -> Self

Performs the % operation. Read more
Source§

impl Rem<u16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: u16) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<u16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: u16) -> Self

Performs the % operation. Read more
Source§

impl Rem<u32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: u32) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: u32) -> Self

Performs the % operation. Read more
Source§

impl Rem<u64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: u64) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<u64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: u64) -> Self

Performs the % operation. Read more
Source§

impl Rem<u8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: u8) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<u8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: u8) -> Self

Performs the % operation. Read more
Source§

impl Rem<usize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: usize) -> Arbi

Performs the % operation. Read more
Source§

impl Rem<usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, other: usize) -> Self

Performs the % operation. Read more
Source§

impl Rem for Arbi

See the div() method.

Source§

type Output = Arbi

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Arbi) -> Arbi

Performs the % operation. Read more
Source§

impl<'a> RemAssign<&'a Arbi> for Arbi

See the div() method.

Source§

fn rem_assign(&mut self, rhs: &'a Arbi)

Performs the %= operation. Read more
Source§

impl RemAssign<&i128> for Arbi

Source§

fn rem_assign(&mut self, other: &i128)

Performs the %= operation. Read more
Source§

impl RemAssign<&i16> for Arbi

Source§

fn rem_assign(&mut self, other: &i16)

Performs the %= operation. Read more
Source§

impl RemAssign<&i32> for Arbi

Source§

fn rem_assign(&mut self, other: &i32)

Performs the %= operation. Read more
Source§

impl RemAssign<&i64> for Arbi

Source§

fn rem_assign(&mut self, other: &i64)

Performs the %= operation. Read more
Source§

impl RemAssign<&i8> for Arbi

Source§

fn rem_assign(&mut self, other: &i8)

Performs the %= operation. Read more
Source§

impl RemAssign<&isize> for Arbi

Source§

fn rem_assign(&mut self, other: &isize)

Performs the %= operation. Read more
Source§

impl RemAssign<&u128> for Arbi

Source§

fn rem_assign(&mut self, other: &u128)

Performs the %= operation. Read more
Source§

impl RemAssign<&u16> for Arbi

Source§

fn rem_assign(&mut self, other: &u16)

Performs the %= operation. Read more
Source§

impl RemAssign<&u32> for Arbi

Source§

fn rem_assign(&mut self, other: &u32)

Performs the %= operation. Read more
Source§

impl RemAssign<&u64> for Arbi

Source§

fn rem_assign(&mut self, other: &u64)

Performs the %= operation. Read more
Source§

impl RemAssign<&u8> for Arbi

Source§

fn rem_assign(&mut self, other: &u8)

Performs the %= operation. Read more
Source§

impl RemAssign<&usize> for Arbi

Source§

fn rem_assign(&mut self, other: &usize)

Performs the %= operation. Read more
Source§

impl RemAssign<i128> for Arbi

Source§

fn rem_assign(&mut self, other: i128)

Performs the %= operation. Read more
Source§

impl RemAssign<i16> for Arbi

Source§

fn rem_assign(&mut self, other: i16)

Performs the %= operation. Read more
Source§

impl RemAssign<i32> for Arbi

Source§

fn rem_assign(&mut self, other: i32)

Performs the %= operation. Read more
Source§

impl RemAssign<i64> for Arbi

Source§

fn rem_assign(&mut self, other: i64)

Performs the %= operation. Read more
Source§

impl RemAssign<i8> for Arbi

Source§

fn rem_assign(&mut self, other: i8)

Performs the %= operation. Read more
Source§

impl RemAssign<isize> for Arbi

Source§

fn rem_assign(&mut self, other: isize)

Performs the %= operation. Read more
Source§

impl RemAssign<u128> for Arbi

Source§

fn rem_assign(&mut self, other: u128)

Performs the %= operation. Read more
Source§

impl RemAssign<u16> for Arbi

Source§

fn rem_assign(&mut self, other: u16)

Performs the %= operation. Read more
Source§

impl RemAssign<u32> for Arbi

Source§

fn rem_assign(&mut self, other: u32)

Performs the %= operation. Read more
Source§

impl RemAssign<u64> for Arbi

Source§

fn rem_assign(&mut self, other: u64)

Performs the %= operation. Read more
Source§

impl RemAssign<u8> for Arbi

Source§

fn rem_assign(&mut self, other: u8)

Performs the %= operation. Read more
Source§

impl RemAssign<usize> for Arbi

Source§

fn rem_assign(&mut self, other: usize)

Performs the %= operation. Read more
Source§

impl RemAssign for Arbi

See the div() method.

Source§

fn rem_assign(&mut self, rhs: Arbi)

Performs the %= operation. Read more
Source§

impl<'a> Shl<&'a i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &'a i32) -> Arbi

Performs the << operation. Read more
Source§

impl<'a> Shl<&'a u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &'a BitCount) -> Arbi

Performs the << operation. Read more
Source§

impl<'a> Shl<&'a u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &'a u32) -> Arbi

Performs the << operation. Read more
Source§

impl<'a> Shl<&'a usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &'a usize) -> Arbi

Performs the << operation. Read more
Source§

impl Shl<i32> for &Arbi

Return an Arbi integer representing this integer left-shifted shift bit positions with vacated bits zero-filled.

Mathematically, the value of the resulting integer is \[ x \times 2^{\text{shift}} \] where \( x \) is the big integer.

This is consistent with Rust’s built-in behavior for left-shifting integers by an unsigned integer value.

The right-hand-side (RHS) of a left shift operation can be a value of type:

  • BitCount
  • usize
  • u32
  • i32

While i32 is supported, please note that negative RHS values cause a panic.

§Panics

  • Panics if rhs is an i32 and its value is negative.
  • Panics if the result of the operation exceeds Vec’s limits.

§Examples

use arbi::Arbi;

assert_eq!(Arbi::zero() << 1, 0);
assert_eq!(0 << 1, 0);

let mut a = Arbi::neg_one();

a <<= 0;
assert_eq!(a, -1);
assert_eq!(a, -1 << 0);

a <<= 1; // in-place
assert_eq!(a, -2);
assert_eq!(a, -1 << 1);

a = a << 1; // in-place
assert_eq!(a, -4);
assert_eq!(a, -1 << 2);

a = &a << 1; // clones (currently)
assert_eq!(a, -8);
assert_eq!(a, -1 << 3);

Negative RHS values cause a panic:

use arbi::Arbi;
let _ = Arbi::zero() << -1;

This panics because it would exceed Vec’s limits:

use arbi::Arbi;
let _ = Arbi::one() << Arbi::MAX_BITS;
§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> Arbi

Performs the << operation. Read more
Source§

impl Shl<i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> Arbi

Performs the << operation. Read more
Source§

impl Shl<u128> for &Arbi

Return an Arbi integer representing this integer left-shifted shift bit positions with vacated bits zero-filled.

Mathematically, the value of the resulting integer is \[ x \times 2^{\text{shift}} \] where \( x \) is the big integer.

This is consistent with Rust’s built-in behavior for left-shifting integers by an unsigned integer value.

The right-hand-side (RHS) of a left shift operation can be a value of type:

  • BitCount
  • usize
  • u32
  • i32

While i32 is supported, please note that negative RHS values cause a panic.

§Panics

  • Panics if rhs is an i32 and its value is negative.
  • Panics if the result of the operation exceeds Vec’s limits.

§Examples

use arbi::Arbi;

assert_eq!(Arbi::zero() << 1, 0);
assert_eq!(0 << 1, 0);

let mut a = Arbi::neg_one();

a <<= 0;
assert_eq!(a, -1);
assert_eq!(a, -1 << 0);

a <<= 1; // in-place
assert_eq!(a, -2);
assert_eq!(a, -1 << 1);

a = a << 1; // in-place
assert_eq!(a, -4);
assert_eq!(a, -1 << 2);

a = &a << 1; // clones (currently)
assert_eq!(a, -8);
assert_eq!(a, -1 << 3);

Negative RHS values cause a panic:

use arbi::Arbi;
let _ = Arbi::zero() << -1;

This panics because it would exceed Vec’s limits:

use arbi::Arbi;
let _ = Arbi::one() << Arbi::MAX_BITS;
§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: BitCount) -> Arbi

Performs the << operation. Read more
Source§

impl Shl<u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: BitCount) -> Arbi

Performs the << operation. Read more
Source§

impl Shl<u32> for &Arbi

Return an Arbi integer representing this integer left-shifted shift bit positions with vacated bits zero-filled.

Mathematically, the value of the resulting integer is \[ x \times 2^{\text{shift}} \] where \( x \) is the big integer.

This is consistent with Rust’s built-in behavior for left-shifting integers by an unsigned integer value.

The right-hand-side (RHS) of a left shift operation can be a value of type:

  • BitCount
  • usize
  • u32
  • i32

While i32 is supported, please note that negative RHS values cause a panic.

§Panics

  • Panics if rhs is an i32 and its value is negative.
  • Panics if the result of the operation exceeds Vec’s limits.

§Examples

use arbi::Arbi;

assert_eq!(Arbi::zero() << 1, 0);
assert_eq!(0 << 1, 0);

let mut a = Arbi::neg_one();

a <<= 0;
assert_eq!(a, -1);
assert_eq!(a, -1 << 0);

a <<= 1; // in-place
assert_eq!(a, -2);
assert_eq!(a, -1 << 1);

a = a << 1; // in-place
assert_eq!(a, -4);
assert_eq!(a, -1 << 2);

a = &a << 1; // clones (currently)
assert_eq!(a, -8);
assert_eq!(a, -1 << 3);

Negative RHS values cause a panic:

use arbi::Arbi;
let _ = Arbi::zero() << -1;

This panics because it would exceed Vec’s limits:

use arbi::Arbi;
let _ = Arbi::one() << Arbi::MAX_BITS;
§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u32) -> Arbi

Performs the << operation. Read more
Source§

impl Shl<u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u32) -> Arbi

Performs the << operation. Read more
Source§

impl Shl<usize> for &Arbi

Return an Arbi integer representing this integer left-shifted shift bit positions with vacated bits zero-filled.

Mathematically, the value of the resulting integer is \[ x \times 2^{\text{shift}} \] where \( x \) is the big integer.

This is consistent with Rust’s built-in behavior for left-shifting integers by an unsigned integer value.

The right-hand-side (RHS) of a left shift operation can be a value of type:

  • BitCount
  • usize
  • u32
  • i32

While i32 is supported, please note that negative RHS values cause a panic.

§Panics

  • Panics if rhs is an i32 and its value is negative.
  • Panics if the result of the operation exceeds Vec’s limits.

§Examples

use arbi::Arbi;

assert_eq!(Arbi::zero() << 1, 0);
assert_eq!(0 << 1, 0);

let mut a = Arbi::neg_one();

a <<= 0;
assert_eq!(a, -1);
assert_eq!(a, -1 << 0);

a <<= 1; // in-place
assert_eq!(a, -2);
assert_eq!(a, -1 << 1);

a = a << 1; // in-place
assert_eq!(a, -4);
assert_eq!(a, -1 << 2);

a = &a << 1; // clones (currently)
assert_eq!(a, -8);
assert_eq!(a, -1 << 3);

Negative RHS values cause a panic:

use arbi::Arbi;
let _ = Arbi::zero() << -1;

This panics because it would exceed Vec’s limits:

use arbi::Arbi;
let _ = Arbi::one() << Arbi::MAX_BITS;
§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: usize) -> Arbi

Performs the << operation. Read more
Source§

impl Shl<usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: usize) -> Arbi

Performs the << operation. Read more
Source§

impl<'a> ShlAssign<&'a i32> for Arbi

Source§

fn shl_assign(&mut self, rhs: &'a i32)

Performs the <<= operation. Read more
Source§

impl<'a> ShlAssign<&'a u128> for Arbi

Source§

fn shl_assign(&mut self, rhs: &'a BitCount)

Performs the <<= operation. Read more
Source§

impl<'a> ShlAssign<&'a u32> for Arbi

Source§

fn shl_assign(&mut self, rhs: &'a u32)

Performs the <<= operation. Read more
Source§

impl<'a> ShlAssign<&'a usize> for Arbi

Source§

fn shl_assign(&mut self, rhs: &'a usize)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i32> for Arbi

Source§

fn shl_assign(&mut self, rhs: i32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u128> for Arbi

Source§

fn shl_assign(&mut self, rhs: BitCount)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u32> for Arbi

Source§

fn shl_assign(&mut self, rhs: u32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<usize> for Arbi

Source§

fn shl_assign(&mut self, rhs: usize)

Performs the <<= operation. Read more
Source§

impl<'a> Shr<&'a i32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &'a i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<'a> Shr<&'a u128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &'a BitCount) -> Self::Output

Performs the >> operation. Read more
Source§

impl<'a> Shr<&'a u32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &'a u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<'a> Shr<&'a usize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &'a usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i32> for &Arbi

Return a new integer representing this integer right-shifted rhs bit positions. This is an arithmetic right shift with sign extension.

Mathematically, the value of the resulting integer is \( \frac{x}{2^{\text{shift}}} \), rounded down: \[ \left\lfloor \frac{x}{2^{\text{shift}}} \right\rfloor \] where \( x \) is the big integer.

This is consistent with Rust’s built-in behavior for right shifting primitive integer type values.

The right-hand-side (RHS) of a right shift operation can be a value of type:

  • BitCount
  • usize
  • u32
  • i32

While i32 is supported, please note that negative RHS values cause a panic.

§Panics

Panics if rhs is an i32 and its value is negative.

§Note

Currently, when right-shifting a reference to an Arbi (&Arbi), the operation involves cloning the Arbi integer, which incurs memory allocation. To avoid these allocations, prefer using the in-place right-shift operator >>= on a mutable reference (&mut Arbi), or the move-based right-shift operator >> on an Arbi instance.

§Examples

use arbi::Arbi;

let mut a = Arbi::from(-987654321);
// In-place
a >>= 1;
assert_eq!(a, -493827161);

// Also in-place
a = a >> 1;
assert_eq!(a, -246913581);

// Clones the Arbi integer
a = &a >> 1;
assert_eq!(a, -123456791);

Negative shifts cause a panic:

use arbi::Arbi;
let _ = Arbi::zero() >> -1;
§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u128> for &Arbi

Return a new integer representing this integer right-shifted rhs bit positions. This is an arithmetic right shift with sign extension.

Mathematically, the value of the resulting integer is \( \frac{x}{2^{\text{shift}}} \), rounded down: \[ \left\lfloor \frac{x}{2^{\text{shift}}} \right\rfloor \] where \( x \) is the big integer.

This is consistent with Rust’s built-in behavior for right shifting primitive integer type values.

The right-hand-side (RHS) of a right shift operation can be a value of type:

  • BitCount
  • usize
  • u32
  • i32

While i32 is supported, please note that negative RHS values cause a panic.

§Panics

Panics if rhs is an i32 and its value is negative.

§Note

Currently, when right-shifting a reference to an Arbi (&Arbi), the operation involves cloning the Arbi integer, which incurs memory allocation. To avoid these allocations, prefer using the in-place right-shift operator >>= on a mutable reference (&mut Arbi), or the move-based right-shift operator >> on an Arbi instance.

§Examples

use arbi::Arbi;

let mut a = Arbi::from(-987654321);
// In-place
a >>= 1;
assert_eq!(a, -493827161);

// Also in-place
a = a >> 1;
assert_eq!(a, -246913581);

// Clones the Arbi integer
a = &a >> 1;
assert_eq!(a, -123456791);

Negative shifts cause a panic:

use arbi::Arbi;
let _ = Arbi::zero() >> -1;
§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: BitCount) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: BitCount) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u32> for &Arbi

Return a new integer representing this integer right-shifted rhs bit positions. This is an arithmetic right shift with sign extension.

Mathematically, the value of the resulting integer is \( \frac{x}{2^{\text{shift}}} \), rounded down: \[ \left\lfloor \frac{x}{2^{\text{shift}}} \right\rfloor \] where \( x \) is the big integer.

This is consistent with Rust’s built-in behavior for right shifting primitive integer type values.

The right-hand-side (RHS) of a right shift operation can be a value of type:

  • BitCount
  • usize
  • u32
  • i32

While i32 is supported, please note that negative RHS values cause a panic.

§Panics

Panics if rhs is an i32 and its value is negative.

§Note

Currently, when right-shifting a reference to an Arbi (&Arbi), the operation involves cloning the Arbi integer, which incurs memory allocation. To avoid these allocations, prefer using the in-place right-shift operator >>= on a mutable reference (&mut Arbi), or the move-based right-shift operator >> on an Arbi instance.

§Examples

use arbi::Arbi;

let mut a = Arbi::from(-987654321);
// In-place
a >>= 1;
assert_eq!(a, -493827161);

// Also in-place
a = a >> 1;
assert_eq!(a, -246913581);

// Clones the Arbi integer
a = &a >> 1;
assert_eq!(a, -123456791);

Negative shifts cause a panic:

use arbi::Arbi;
let _ = Arbi::zero() >> -1;
§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

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

Performs the >> operation. Read more
Source§

impl Shr<u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

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

Performs the >> operation. Read more
Source§

impl Shr<usize> for &Arbi

Return a new integer representing this integer right-shifted rhs bit positions. This is an arithmetic right shift with sign extension.

Mathematically, the value of the resulting integer is \( \frac{x}{2^{\text{shift}}} \), rounded down: \[ \left\lfloor \frac{x}{2^{\text{shift}}} \right\rfloor \] where \( x \) is the big integer.

This is consistent with Rust’s built-in behavior for right shifting primitive integer type values.

The right-hand-side (RHS) of a right shift operation can be a value of type:

  • BitCount
  • usize
  • u32
  • i32

While i32 is supported, please note that negative RHS values cause a panic.

§Panics

Panics if rhs is an i32 and its value is negative.

§Note

Currently, when right-shifting a reference to an Arbi (&Arbi), the operation involves cloning the Arbi integer, which incurs memory allocation. To avoid these allocations, prefer using the in-place right-shift operator >>= on a mutable reference (&mut Arbi), or the move-based right-shift operator >> on an Arbi instance.

§Examples

use arbi::Arbi;

let mut a = Arbi::from(-987654321);
// In-place
a >>= 1;
assert_eq!(a, -493827161);

// Also in-place
a = a >> 1;
assert_eq!(a, -246913581);

// Clones the Arbi integer
a = &a >> 1;
assert_eq!(a, -123456791);

Negative shifts cause a panic:

use arbi::Arbi;
let _ = Arbi::zero() >> -1;
§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl ShrAssign<&i32> for Arbi

Source§

fn shr_assign(&mut self, rhs: &i32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u128> for Arbi

Source§

fn shr_assign(&mut self, rhs: &BitCount)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u32> for Arbi

Source§

fn shr_assign(&mut self, rhs: &u32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&usize> for Arbi

Source§

fn shr_assign(&mut self, rhs: &usize)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i32> for Arbi

Source§

fn shr_assign(&mut self, rhs: i32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u128> for Arbi

Source§

fn shr_assign(&mut self, rhs: BitCount)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u32> for Arbi

Source§

fn shr_assign(&mut self, rhs: u32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<usize> for Arbi

Source§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
Source§

impl<'b> Sub<&'b Arbi> for &Arbi

Implements &self - &rhs.

§Examples

use arbi::Arbi;
let a = Arbi::from(-1234567);
let b = Arbi::from(-123456);
let c = &a - &b; // memory allocation
assert_eq!(c, -1111111);

§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'b Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &i128

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &i16

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &i32

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &i64

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &i8

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &isize

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &u128

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &u16

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &u32

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &u64

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &u8

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for &usize

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl<'a> Sub<&'a Arbi> for Arbi

Implements self - &rhs.

§Examples

use arbi::Arbi;
let a = Arbi::from(-1234567);
let a_cap = a.capacity();
let b = Arbi::from(-123456);
let c = a - &b; // no memory allocation
assert_eq!(c, -1111111);
assert_eq!(c.capacity(), a_cap);

§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'a Arbi) -> Self

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for i128

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for i16

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for i32

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for i64

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for i8

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for isize

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for u128

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for u16

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for u32

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for u64

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for u8

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&Arbi> for usize

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&i128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &i128) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&i128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &i128) -> Self

Performs the - operation. Read more
Source§

impl Sub<&i16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &i16) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&i16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &i16) -> Self

Performs the - operation. Read more
Source§

impl Sub<&i32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &i32) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &i32) -> Self

Performs the - operation. Read more
Source§

impl Sub<&i64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &i64) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&i64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &i64) -> Self

Performs the - operation. Read more
Source§

impl Sub<&i8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &i8) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&i8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &i8) -> Self

Performs the - operation. Read more
Source§

impl Sub<&isize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &isize) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&isize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &isize) -> Self

Performs the - operation. Read more
Source§

impl Sub<&u128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u128) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u128) -> Self

Performs the - operation. Read more
Source§

impl Sub<&u16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u16) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&u16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u16) -> Self

Performs the - operation. Read more
Source§

impl Sub<&u32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u32) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u32) -> Self

Performs the - operation. Read more
Source§

impl Sub<&u64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u64) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&u64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u64) -> Self

Performs the - operation. Read more
Source§

impl Sub<&u8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u8) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&u8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u8) -> Self

Performs the - operation. Read more
Source§

impl Sub<&usize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &usize) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<&usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: &usize) -> Self

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &Arbi

Implements &self - rhs.

§Examples

use arbi::{Arbi, Digit};

let a = Arbi::from(1234567);
let b = Arbi::from(123456);
let b_cap = b.capacity();
let c = &a - b; // In this case, no memory allocation (b's memory is
                // used.
assert_eq!(c, 1111111);
assert_eq!(c.capacity(), b_cap);

let a = Arbi::from(-(Digit::MAX as i128));
let b = Arbi::from(-1234567);
let b_cap = b.capacity();
let c = &a - b; // In this case, no memory allocation
assert_eq!(c.capacity(), b_cap);

§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &i128

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &i16

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &i32

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &i64

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &i8

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &isize

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &u128

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &u16

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &u32

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &u64

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &u8

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for &usize

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for i128

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for i16

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for i32

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for i64

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for i8

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for isize

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for u128

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for u16

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for u32

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for u64

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for u8

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<Arbi> for usize

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Arbi) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<i128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: i128) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<i128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: i128) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<i16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: i16) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<i16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: i16) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<i32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: i32) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<i32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: i32) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<i64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: i64) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<i64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: i64) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<i8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: i8) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<i8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: i8) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<isize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: isize) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<isize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: isize) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<u128> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: u128) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<u128> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: u128) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<u16> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: u16) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<u16> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: u16) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<u32> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: u32) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<u32> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: u32) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<u64> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: u64) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<u64> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: u64) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<u8> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: u8) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<u8> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: u8) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<usize> for &Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: usize) -> Arbi

Performs the - operation. Read more
Source§

impl Sub<usize> for Arbi

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: usize) -> Arbi

Performs the - operation. Read more
Source§

impl Sub for Arbi

Implements self - rhs.

§Examples

use arbi::Arbi;
let a = Arbi::from(-1234567);
let a_cap = a.capacity();
let b = Arbi::from(-123456);
let c = a - b; // no memory allocation
assert_eq!(c, -1111111);
assert_eq!(c.capacity(), a_cap);

§Complexity

\( O(n) \)

Source§

type Output = Arbi

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
Source§

impl<'a> SubAssign<&'a Arbi> for Arbi

Implements self -= &rhs.

§Examples

use arbi::Arbi;
let mut a = Arbi::from(-1234567);
let b = Arbi::from(-123456);
a -= &b;
assert_eq!(a, -1111111);

§Complexity

\( O(n) \)

Source§

fn sub_assign(&mut self, other: &'a Arbi)

Performs the -= operation. Read more
Source§

impl SubAssign<&i128> for Arbi

Source§

fn sub_assign(&mut self, other: &i128)

Performs the -= operation. Read more
Source§

impl SubAssign<&i16> for Arbi

Source§

fn sub_assign(&mut self, other: &i16)

Performs the -= operation. Read more
Source§

impl SubAssign<&i32> for Arbi

Source§

fn sub_assign(&mut self, other: &i32)

Performs the -= operation. Read more
Source§

impl SubAssign<&i64> for Arbi

Source§

fn sub_assign(&mut self, other: &i64)

Performs the -= operation. Read more
Source§

impl SubAssign<&i8> for Arbi

Source§

fn sub_assign(&mut self, other: &i8)

Performs the -= operation. Read more
Source§

impl SubAssign<&isize> for Arbi

Source§

fn sub_assign(&mut self, other: &isize)

Performs the -= operation. Read more
Source§

impl SubAssign<&u128> for Arbi

Source§

fn sub_assign(&mut self, other: &u128)

Performs the -= operation. Read more
Source§

impl SubAssign<&u16> for Arbi

Source§

fn sub_assign(&mut self, other: &u16)

Performs the -= operation. Read more
Source§

impl SubAssign<&u32> for Arbi

Source§

fn sub_assign(&mut self, other: &u32)

Performs the -= operation. Read more
Source§

impl SubAssign<&u64> for Arbi

Source§

fn sub_assign(&mut self, other: &u64)

Performs the -= operation. Read more
Source§

impl SubAssign<&u8> for Arbi

Source§

fn sub_assign(&mut self, other: &u8)

Performs the -= operation. Read more
Source§

impl SubAssign<&usize> for Arbi

Source§

fn sub_assign(&mut self, other: &usize)

Performs the -= operation. Read more
Source§

impl SubAssign<i128> for Arbi

Source§

fn sub_assign(&mut self, other: i128)

Performs the -= operation. Read more
Source§

impl SubAssign<i16> for Arbi

Source§

fn sub_assign(&mut self, other: i16)

Performs the -= operation. Read more
Source§

impl SubAssign<i32> for Arbi

Source§

fn sub_assign(&mut self, other: i32)

Performs the -= operation. Read more
Source§

impl SubAssign<i64> for Arbi

Source§

fn sub_assign(&mut self, other: i64)

Performs the -= operation. Read more
Source§

impl SubAssign<i8> for Arbi

Source§

fn sub_assign(&mut self, other: i8)

Performs the -= operation. Read more
Source§

impl SubAssign<isize> for Arbi

Source§

fn sub_assign(&mut self, other: isize)

Performs the -= operation. Read more
Source§

impl SubAssign<u128> for Arbi

Source§

fn sub_assign(&mut self, other: u128)

Performs the -= operation. Read more
Source§

impl SubAssign<u16> for Arbi

Source§

fn sub_assign(&mut self, other: u16)

Performs the -= operation. Read more
Source§

impl SubAssign<u32> for Arbi

Source§

fn sub_assign(&mut self, other: u32)

Performs the -= operation. Read more
Source§

impl SubAssign<u64> for Arbi

Source§

fn sub_assign(&mut self, other: u64)

Performs the -= operation. Read more
Source§

impl SubAssign<u8> for Arbi

Source§

fn sub_assign(&mut self, other: u8)

Performs the -= operation. Read more
Source§

impl SubAssign<usize> for Arbi

Source§

fn sub_assign(&mut self, other: usize)

Performs the -= operation. Read more
Source§

impl SubAssign for Arbi

Implements self -= rhs.

§Examples

use arbi::Arbi;
let mut a = Arbi::from(-1234567);
let b = Arbi::from(-123456);
a -= b;
assert_eq!(a, -1111111);

§Complexity

\( O(n) \)

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

impl Eq for Arbi

Auto Trait Implementations§

§

impl Freeze for Arbi

§

impl RefUnwindSafe for Arbi

§

impl Send for Arbi

§

impl Sync for Arbi

§

impl Unpin for Arbi

§

impl UnwindSafe for Arbi

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<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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> 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§

default 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.