cprover
mp_arith.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_UTIL_MP_ARITH_H
11 #define CPROVER_UTIL_MP_ARITH_H
12 
13 #include <string>
14 #include <iosfwd>
15 
16 #include "big-int/bigint.hh"
17 
18 // NOLINTNEXTLINE(readability/identifiers)
19 typedef BigInt mp_integer;
20 
21 std::ostream &operator<<(std::ostream &, const mp_integer &);
22 mp_integer operator>>(const mp_integer &, const mp_integer &);
23 mp_integer operator<<(const mp_integer &, const mp_integer &);
24 
25 const std::string integer2string(const mp_integer &, unsigned base=10);
26 const mp_integer string2integer(const std::string &, unsigned base=10);
27 const std::string integer2binary(const mp_integer &, std::size_t width);
28 const mp_integer binary2integer(const std::string &, bool is_signed);
29 mp_integer::ullong_t integer2ulong(const mp_integer &);
30 std::size_t integer2size_t(const mp_integer &);
31 unsigned integer2unsigned(const mp_integer &);
32 
33 #endif // CPROVER_UTIL_MP_ARITH_H
bool is_signed(const typet &t)
Convenience function – is the type signed?
Definition: util.cpp:45
BigInt mp_integer
Definition: mp_arith.h:19
const std::string integer2string(const mp_integer &, unsigned base=10)
Definition: mp_arith.cpp:104
const mp_integer binary2integer(const std::string &, bool is_signed)
convert binary string representation to mp_integer
Definition: mp_arith.cpp:120
std::size_t integer2size_t(const mp_integer &)
Definition: mp_arith.cpp:195
std::ostream & operator<<(std::ostream &, const mp_integer &)
Definition: mp_arith.cpp:44
mp_integer::ullong_t integer2ulong(const mp_integer &)
Definition: mp_arith.cpp:189
const mp_integer string2integer(const std::string &, unsigned base=10)
Definition: mp_arith.cpp:53
mp_integer operator>>(const mp_integer &, const mp_integer &)
Definition: mp_arith.cpp:21
const std::string integer2binary(const mp_integer &, std::size_t width)
Definition: mp_arith.cpp:63
unsigned integer2unsigned(const mp_integer &)
Definition: mp_arith.cpp:203