Include file:

#include "mcrl2/utilities/big_numbers.h
class mcrl2::utilities::big_natural_number

Protected attributes

std::vector<std::size_t> m_number


friend void swap

Standard overload of swap.

Protected member functions

void is_well_defined() const
void multiply_by(std::size_t n, std::size_t carry)
void print_number(const std::string &s) const
void remove_significant_digits_that_are_zero()

Public member functions

void add(const big_natural_number &other)
big_natural_number(const std::size_t n)
big_natural_number(const std::string &s)
void clear()

Sets the number to zero.

This is more efficient than using an assignment x=0.

void div_mod(const big_natural_number &other, big_natural_number &result, big_natural_number &remainder, big_natural_number &calculation_buffer_divisor) const
std::size_t divide_by(std::size_t n)
bool is_number(std::size_t n) const

Returns whether this number equals a number of std::size_t.

This is more efficient than checking x==big_natural_number(1).

bool is_zero() const

Returns whether this number equals zero.

This is more efficient than checking x==big_natural_number(0).

void multiply(const big_natural_number &other, big_natural_number &result, big_natural_number &calculation_buffer_for_multiplicand) const
operator std::size_t() const

Transforms this number to a std::size_t, provided it is sufficiently small. If not an mcrl2::runtime_error is thrown.

bool operator!=(const big_natural_number &other) const
big_natural_number operator%(const big_natural_number &other) const
big_natural_number operator*(const big_natural_number &other) const
big_natural_number operator+(const big_natural_number &other) const
big_natural_number operator-(const big_natural_number &other) const
big_natural_number operator/(const big_natural_number &other) const
bool operator<(const big_natural_number &other) const
bool operator<=(const big_natural_number &other) const
bool operator==(const big_natural_number &other) const
bool operator>(const big_natural_number &other) const
bool operator>=(const big_natural_number &other) const
void subtract(const big_natural_number &other)