[][src]Struct boa::builtins::bigint::BigInt

pub struct BigInt(_);

BigInt implementation.

Implementations

impl BigInt[src]

pub fn from_string_radix(buf: &str, radix: u32) -> Option<Self>[src]

Converts a string to a BigInt with the specified radix.

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

Convert bigint to string with radix.

pub fn to_f64(&self) -> f64[src]

Converts the BigInt to a f64 type.

Returns std::f64::INFINITY if the BigInt is too big.

impl BigInt[src]

pub fn pow(self, other: &Self) -> Result<Self, String>[src]

pub fn shift_right(mut self: Self, other: Self) -> Result<Self, String>[src]

pub fn shift_left(mut self: Self, other: Self) -> Result<Self, String>[src]

pub fn mod_floor(self, other: &Self) -> Self[src]

Floored integer modulo.

Examples

assert_eq!((8).mod_floor(&3), 2);
assert_eq!((8).mod_floor(&-3), -1);

Trait Implementations

impl Add<BigInt> for BigInt[src]

type Output = Self

The resulting type after applying the + operator.

impl BitAnd<BigInt> for BigInt[src]

type Output = Self

The resulting type after applying the & operator.

impl BitOr<BigInt> for BigInt[src]

type Output = Self

The resulting type after applying the | operator.

impl BitXor<BigInt> for BigInt[src]

type Output = Self

The resulting type after applying the ^ operator.

impl Clone for BigInt[src]

impl Debug for BigInt[src]

impl Default for BigInt[src]

impl Display for BigInt[src]

impl Div<BigInt> for BigInt[src]

type Output = Self

The resulting type after applying the / operator.

impl Eq for BigInt[src]

impl Finalize for BigInt[src]

impl From<BigInt> for Const[src]

impl From<BigInt> for Numeric[src]

impl From<BigInt> for Value[src]

impl From<BigInt> for RcBigInt[src]

impl From<BigInt> for Numeric[src]

impl From<i32> for BigInt[src]

impl From<i64> for BigInt[src]

impl Hash for BigInt[src]

impl Mul<BigInt> for BigInt[src]

type Output = Self

The resulting type after applying the * operator.

impl Neg for BigInt[src]

type Output = Self

The resulting type after applying the - operator.

impl Ord for BigInt[src]

impl PartialEq<BigInt> for BigInt[src]

impl PartialEq<f64> for BigInt[src]

impl PartialEq<i32> for BigInt[src]

impl PartialOrd<BigInt> for BigInt[src]

impl Rem<BigInt> for BigInt[src]

type Output = Self

The resulting type after applying the % operator.

impl StructuralEq for BigInt[src]

impl StructuralPartialEq for BigInt[src]

impl Sub<BigInt> for BigInt[src]

type Output = Self

The resulting type after applying the - operator.

impl Trace for BigInt[src]

impl TryFrom<f64> for BigInt[src]

type Error = TryFromF64Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> NativeObject for T where
    T: Any + Debug + Trace
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,