Enum reform::number::Number[][src]

pub enum Number {
    SmallInt(isize),
    BigInt(Integer),
    SmallRat(isizeisize),
    BigRat(Box<Rational>),
}

A number is either a small number consisting of machine sized integers or a big number, using GMP.

The mathematical operations on a number automatically upgrade and downgrade to bigint/smallint etc. TODO: hash should take into account that some bigints can be equal to smallint?

Variants

Methods

impl Number
[src]

Returns the factorial of the number.

impl Number
[src]

Trait Implementations

impl Debug for Number
[src]

Formats the value using the given formatter. Read more

impl Clone for Number
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Hash for Number
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Number
[src]

Compare numbers. Big integers can also match small integers.

This method tests for !=.

impl Eq for Number
[src]

impl Display for Number
[src]

Formats the value using the given formatter. Read more

impl Zero for Number
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl GCD for Number
[src]

impl One for Number
[src]

Returns the multiplicative identity element of Self, 1. Read more

Returns true if self is equal to the multiplicative identity. Read more

impl Neg for Number
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl Inv for Number
[src]

The result after applying the operator.

Returns the multiplicative inverse of self. Read more

impl PartialOrd for Number
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for Number
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Add for Number
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Sub for Number
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Mul for Number
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Div for Number
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Rem for Number
[src]

The resulting type after applying the % operator.

Performs the % operation.

impl Pow<u32> for Number
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl MulAssign for Number
[src]

Performs the *= operation.

impl AddAssign for Number
[src]

Performs the += operation.

impl Mul<Number> for Polynomial
[src]

The resulting type after applying the * operator.

Performs the * operation.

Auto Trait Implementations

impl Send for Number

impl Sync for Number