Class Integer

Inheritance Relationships

Base Type

Class Documentation

class SymEngine::Integer : public SymEngine::Number

Integer Class.

Public Functions

Integer(const integer_class &_i)

Constructor of Integer using integer_class

Integer(integer_class &&_i)
hash_t __hash__() const

Return

size of the hash

bool __eq__(const Basic &o) const

Equality comparator

Return

whether the 2 objects are equal

Parameters
  • o: - Object to be compared with

int compare(const Basic &o) const

Returns -1, 0, 1 for this < o, this == o, this > o. This method is used when you want to sort things like x+y+z into canonical order. This function assumes that o is the same type as this. Use __cmp__ if you want general comparison.

signed long int as_int() const

Convert to int, raise an exception if it does not fit.

unsigned long int as_uint() const

Convert to uint, raise an exception if it does not fit.

const integer_class &as_integer_class() const

Convert to integer_class.

bool is_zero() const

Return

true if 0

bool is_one() const

Return

true if 1

bool is_minus_one() const

Return

true if -1

bool is_positive() const

Return

true if positive

bool is_negative() const

Return

true if negative

bool is_complex() const

Return

false

RCP<const Integer> addint(const Integer &other) const

Fast Integer Addition.

RCP<const Integer> subint(const Integer &other) const

Fast Integer Subtraction.

RCP<const Integer> mulint(const Integer &other) const

Fast Integer Multiplication.

RCP<const Number> divint(const Integer &other) const

Integer Division.

RCP<const Number> pow_negint(const Integer &other) const

Fast Negative Power Evaluation.

RCP<const Number> powint(const Integer &other) const

Fast Power Evaluation.

RCP<const Integer> neg() const

Return

negative of self.

RCP<const Number> add(const Number &other) const

Slower Addition.

RCP<const Number> sub(const Number &other) const

Slower Subtraction.

RCP<const Number> rsub(const Number &other) const
RCP<const Number> mul(const Number &other) const

Slower Multiplication.

RCP<const Number> div(const Number &other) const

Slower Division.

RCP<const Number> rdiv(const Number &other) const
RCP<const Number> pow(const Number &other) const

Slower power evaluation.

RCP<const Number> rpow(const Number &other) const