BigInt
struct BigInt
operator ^
pub fn operator ^(self, other: BigInt): BigInt
operator ^
pub fn operator ^(self, other: BigInt): BigInt
operator |
pub fn operator |(self, other: BigInt): BigInt
operator |
pub fn operator |(self, other: BigInt): BigInt
operator &
pub fn operator &(self, other: BigInt): BigInt
operator &
pub fn operator &(self, other: BigInt): BigInt
operator !=
pub fn operator !=(self, other: BigInt): bool
operator !=
pub fn operator !=(self, other: BigInt): bool
operator ==
pub fn operator ==(self, other: BigInt): bool
operator ==
pub fn operator ==(self, other: BigInt): bool
operator %
pub fn operator %(self, other: BigInt): BigInt
operator %
pub fn operator %(self, other: BigInt): BigInt
operator /
pub fn operator /(self, other: BigInt): BigInt
operator /
pub fn operator /(self, other: BigInt): BigInt
operator *
pub fn operator *(self, other: BigInt): BigInt
operator *
pub fn operator *(self, other: BigInt): BigInt
operator -
pub fn operator -(self, other: BigInt): BigInt
operator -
pub fn operator -(self, other: BigInt): BigInt
operator +
pub fn operator +(self, other: BigInt): BigInt
operator +
pub fn operator +(self, other: BigInt): BigInt
from_bytes_be
pub fn from_bytes_be(sign: Sign, bytes: Bytes): BigInt
[src]
pub fn from_bytes_be(sign: Sign, bytes: Bytes): BigInt {
return BigInt._from_bytes_be(sign as int, bytes);
}
Creates and initializes a BigInt
.
from_bytes_be
pub fn from_bytes_be(sign: Sign, bytes: Bytes): BigInt
[src]
pub fn from_bytes_be(sign: Sign, bytes: Bytes): BigInt {
return BigInt._from_bytes_be(sign as int, bytes);
}
Creates and initializes a BigInt
.
Creates and initializes a BigInt
.
The bytes are in big-endian byte order.
from_bytes_le
pub fn from_bytes_le(sign: Sign, bytes: Bytes): BigInt
[src]
pub fn from_bytes_le(sign: Sign, bytes: Bytes): BigInt {
return BigInt._from_bytes_le(sign as int, bytes);
}
Creates and initializes a BigInt
.
from_bytes_le
pub fn from_bytes_le(sign: Sign, bytes: Bytes): BigInt
[src]
pub fn from_bytes_le(sign: Sign, bytes: Bytes): BigInt {
return BigInt._from_bytes_le(sign as int, bytes);
}
Creates and initializes a BigInt
.
Creates and initializes a BigInt
.
The bytes are in little-endian byte order.
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>.
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>.
parse
pub fn parse(s: string): BigInt throws ParseBigIntError
parse
pub fn parse(s: string): BigInt throws ParseBigIntError
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.
Returns the truncated principal cube root.
Returns the truncated principal cube root.
Returns the truncated principal cube root.
Ceiled integer division.
Ceiled integer division.
Ceiled integer division.
Floored integer division.
Floored integer division.
Floored integer division.
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 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
.
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 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.
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
.
Floored integer modulo.
Floored integer modulo.
Floored integer modulo.
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.
[src]
pub fn sign(self): Sign {
return (self._sign() as Sign)!;
}
Returns the sign of the BigInt
.
[src]
pub fn sign(self): Sign {
return (self._sign() as Sign)!;
}
Returns the sign of the BigInt
.
Returns the sign of the BigInt
.
Returns the truncated principal square root.
Returns the truncated principal square root.
Returns the truncated principal square root.
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.
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_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_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.