BigInt
struct BigInt
to_signed_bytes_le
pub fn to_signed_bytes_le(self): Bytes
Returns the two's complement byte representation of the BigInt
in little-endian byte order.
to_signed_bytes_le
pub fn to_signed_bytes_le(self): Bytes
Returns the two's complement byte representation of the BigInt
in little-endian byte order.
Returns the two's complement byte representation of the BigInt
in little-endian byte order.
to_signed_bytes_be
pub fn to_signed_bytes_be(self): Bytes
Returns the two's complement byte representation of the BigInt
in big-endian byte order.
to_signed_bytes_be
pub fn to_signed_bytes_be(self): Bytes
Returns the two's complement byte representation of the BigInt
in big-endian byte order.
Returns the two's complement byte representation of the BigInt
in big-endian byte order.
to_bytes_le
pub fn to_bytes_le(self): Bytes
Returns the the byte representation of the BigInt in little-endian byte order.
to_bytes_le
pub fn to_bytes_le(self): Bytes
Returns the the byte representation of the BigInt in little-endian byte order.
Returns the the byte representation of the BigInt in little-endian byte order.
to_bytes_be
pub fn to_bytes_be(self): Bytes
Returns the the byte representation of the BigInt in big-endian byte order.
to_bytes_be
pub fn to_bytes_be(self): Bytes
Returns the the byte representation of the BigInt in big-endian byte order.
Returns the the byte representation of the BigInt in big-endian byte order.
Returns true
if self
is equal to the additive identity.
Returns true
if self
is equal to the additive identity.
Returns true
if self
is equal to the additive identity.
operator^:2
pub fn operator^:2(self, other: BigInt): BigInt
operator^:2
pub fn operator^:2(self, other: BigInt): BigInt
operator|:2
pub fn operator|:2(self, other: BigInt): BigInt
operator|:2
pub fn operator|:2(self, other: BigInt): BigInt
operator&:2
pub fn operator&:2(self, other: BigInt): BigInt
operator&:2
pub fn operator&:2(self, other: BigInt): BigInt
operator!=:2
pub fn operator!=:2(self, other: BigInt): bool
operator!=:2
pub fn operator!=:2(self, other: BigInt): bool
operator==:2
pub fn operator==:2(self, other: BigInt): bool
operator==:2
pub fn operator==:2(self, other: BigInt): bool
operator%:2
pub fn operator%:2(self, other: BigInt): BigInt
operator%:2
pub fn operator%:2(self, other: BigInt): BigInt
operator/:2
pub fn operator/:2(self, other: BigInt): BigInt
operator/:2
pub fn operator/:2(self, other: BigInt): BigInt
operator*:2
pub fn operator*:2(self, other: BigInt): BigInt
operator*:2
pub fn operator*:2(self, other: BigInt): BigInt
operator-:2
pub fn operator-:2(self, other: BigInt): BigInt
operator-:2
pub fn operator-:2(self, other: BigInt): BigInt
operator+:2
pub fn operator+:2(self, other: BigInt): BigInt
operator+:2
pub fn operator+:2(self, other: BigInt): BigInt
Ceiled integer division.
Ceiled integer division.
Ceiled integer division.
Floored integer modulo.
Floored integer modulo.
Floored integer modulo.
Floored integer division.
Floored integer division.
Floored integer division.
Returns true
if the number is not divisible by 2
.
Returns true
if the number is not divisible by 2
.
Returns true
if the number is not divisible by 2
.
Returns true
if the number is divisible by 2
.
Returns true
if the number is divisible by 2
.
Returns true
if the number is divisible by 2
.
is_multiple_of
pub fn is_multiple_of(self, other: BigInt): bool
Returns true
if the number is a multiple of other
.
is_multiple_of
pub fn is_multiple_of(self, other: BigInt): bool
Returns true
if the number is a multiple of other
.
Returns true
if the number is a multiple of other
.
Calculates the Lowest Common Multiple (LCM) of the number and other
.
Calculates the Lowest Common Multiple (LCM) of the number and other
.
Calculates the Lowest Common Multiple (LCM) of the number and other
.
Calculates the Greatest Common Divisor (GCD) of the number and other
.
Calculates the Greatest Common Divisor (GCD) of the number and other
.
Calculates the Greatest Common Divisor (GCD) of the number and other
.
The result is always positive.
Returns the truncated principal square root.
Returns the truncated principal square root.
Returns the truncated principal square root.
Returns (self ^ exponent) mod modulus.
Returns (self ^ exponent) mod modulus.
Returns (self ^ exponent) mod modulus.
Note that this rounds like mod_floor
, not like the %
operator, which makes a difference when given a negative self
or modulus
.
The result will be in the interval [0, modulus)
for modulus > 0
, or in the interval (modulus, 0]
for modulus < 0
Panics if the exponent is negative or the modulus is zero.
Returns the truncated principal cube root.
Returns the truncated principal cube root.
Returns the truncated principal cube root.
Determines the fewest bits necessary to express the BigUint.
Determines the fewest bits necessary to express the BigUint.
Determines the fewest bits necessary to express the BigUint.
from_signed_bytes_le
pub fn from_signed_bytes_le(bytes: Bytes): BigInt
Creates and initializes a BigInt
from an array of bytes in two's complement.
from_signed_bytes_le
pub fn from_signed_bytes_le(bytes: Bytes): BigInt
Creates and initializes a BigInt
from an array of bytes in two's complement.
Creates and initializes a BigInt
from an array of bytes in two's complement.
The digits are in little-endian base 2<sup>8</sup>.
_from_bytes_le
pub fn _from_bytes_le(sign: int, bytes: Bytes): BigInt
_from_bytes_le
pub fn _from_bytes_le(sign: int, bytes: Bytes): BigInt
_from_bytes_be
pub fn _from_bytes_be(sign: int, bytes: Bytes): BigInt
_from_bytes_be
pub fn _from_bytes_be(sign: int, bytes: Bytes): BigInt
from_signed_bytes_be
pub fn from_signed_bytes_be(bytes: Bytes): BigInt
Creates and initializes a BigInt
from an array of bytes in two's complement binary representation.
from_signed_bytes_be
pub fn from_signed_bytes_be(bytes: Bytes): BigInt
Creates and initializes a BigInt
from an array of bytes in two's complement binary representation.
Creates and initializes a BigInt
from an array of bytes in two's complement binary representation.
The digits are in big-endian base 2<sup>8</sup>.
parse
pub fn parse(s: string): BigInt throws ParseBigIntError
parse
pub fn parse(s: string): BigInt throws ParseBigIntError