Struct bert::BertBigInteger [] [src]

pub struct BertBigInteger(pub BigInt);

Methods from Deref<Target = BigInt>

Returns the sign and the byte representation of the BigInt in little-endian byte order.

Examples

use num_bigint::{ToBigInt, Sign};

let i = -1125.to_bigint().unwrap();
assert_eq!(i.to_bytes_le(), (Sign::Minus, vec![101, 4]));

Returns the sign and the byte representation of the BigInt in big-endian byte order.

Examples

use num_bigint::{ToBigInt, Sign};

let i = -1125.to_bigint().unwrap();
assert_eq!(i.to_bytes_be(), (Sign::Minus, vec![4, 101]));

Returns the integer formatted as a string in the given radix. radix must be in the range [2, 36].

Examples

use num_bigint::BigInt;

let i = BigInt::parse_bytes(b"ff", 16).unwrap();
assert_eq!(i.to_str_radix(16), "ff");

Returns the sign of the BigInt as a Sign.

Examples

use num_bigint::{ToBigInt, Sign};

assert_eq!(ToBigInt::to_bigint(&1234).unwrap().sign(), Sign::Plus);
assert_eq!(ToBigInt::to_bigint(&-4321).unwrap().sign(), Sign::Minus);
assert_eq!(ToBigInt::to_bigint(&0).unwrap().sign(), Sign::NoSign);

Determines the fewest bits necessary to express the BigInt, not including the sign.

Converts this BigInt into a BigUint, if it's not negative.

Trait Implementations

impl Debug for BertBigInteger
[src]

Formats the value using the given formatter.

impl PartialEq for BertBigInteger
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Deref for BertBigInteger
[src]

The resulting type after dereferencing

The method called to dereference a value

impl Serialize for BertBigInteger
[src]

Serializes this value into this serializer.