1 #include <symengine/mp_wrapper.h>
7 #if SYMENGINE_INTEGER_CLASS == SYMENGINE_FLINT
8 std::ostream &
operator<<(std::ostream &os,
const fmpz_wrapper &f)
10 void (*freefunc)(
void *, size_t);
11 mp_get_memory_functions(NULL, NULL, &freefunc);
12 char *c = fmpz_get_str(NULL, 10, f.get_fmpz_t());
14 freefunc(c, strlen(c) + 1);
18 std::ostream &
operator<<(std::ostream &os,
const fmpq_wrapper &f)
20 void (*freefunc)(
void *, size_t);
21 mp_get_memory_functions(NULL, NULL, &freefunc);
22 char *c = fmpq_get_str(NULL, 10, f.get_fmpq_t());
24 freefunc(c, strlen(c) + 1);
27 #elif SYMENGINE_INTEGER_CLASS == SYMENGINE_GMP
29 std::ostream &
operator<<(std::ostream &os,
const mpz_wrapper &f)
31 void (*freefunc)(
void *, size_t);
32 mp_get_memory_functions(NULL, NULL, &freefunc);
33 char *c = mpz_get_str(NULL, 10, f.get_mpz_t());
35 freefunc(c, strlen(c) + 1);
39 std::ostream &
operator<<(std::ostream &os,
const mpq_wrapper &f)
41 void (*freefunc)(
void *, size_t);
42 mp_get_memory_functions(NULL, NULL, &freefunc);
43 char *c = mpq_get_str(NULL, 10, f.get_mpq_t());
45 freefunc(c, strlen(c) + 1);
Main namespace for SymEngine package.
std::ostream & operator<<(std::ostream &out, const SymEngine::Basic &p)
<< Operator