File: bigint.hpp

package info (click to toggle)
iqtree 2.0.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 14,620 kB
  • sloc: cpp: 142,571; ansic: 57,789; sh: 275; python: 242; makefile: 95
file content (33 lines) | stat: -rw-r--r-- 900 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef TERRACES_BIGINT_HPP
#define TERRACES_BIGINT_HPP

#include "definitions.hpp"

#ifndef USE_GMP
#include "clamped_uint.hpp"
namespace terraces {
using big_integer = terraces::overflow_except_uint;
}
#else
#include <gmpxx.h>
#include <iosfwd>
namespace terraces {
class big_integer {
	mpz_class m_value;

public:
	big_integer(index i = 0);
	big_integer& operator+=(const big_integer& other);
	big_integer& operator*=(const big_integer& other);
	bool is_clamped() const;
	const mpz_class& value() const;
};
bool operator==(const big_integer& a, const big_integer& b);
bool operator!=(const big_integer& a, const big_integer& b);
big_integer operator+(const big_integer& a, const big_integer& b);
big_integer operator*(const big_integer& a, const big_integer& b);
std::ostream& operator<<(std::ostream& stream, const big_integer& val);
} // namespace terraces
#endif

#endif // TERRACES_BIGINT_HPP