36 #error "arith_mulprec.h requires GMP"
39 #ifdef LINEAR_ARITH_FIXPREC_H
40 #error "arith_fixprec.h and arith_mulprec.h are both loaded"
43 #ifndef LINEAR_ARITH_MULPREC_H
44 #define LINEAR_ARITH_MULPREC_H
54 #define NOWUNUSED __attribute__((unused))
72 #define zval_init(z) (mpz_init(z))
77 #define zval_clear(z) (mpz_clear(z))
82 #define zval_set(z1, z2) (mpz_set(z1, z2))
87 #define zval_set_i(z, n) (mpz_set_si(z, n))
92 #define zval_init_set(z1, z2) (mpz_init_set(z1, z2))
97 #define zval_init_set_i(z, n) (mpz_init_set_si(z, n))
102 #define zval_get_i(z) (mpz_get_si(z))
107 #define zval_add(z1, z2, z3) (mpz_add(z1, z2, z3))
112 #define zval_sub(z1, z2, z3) (mpz_sub(z1, z2, z3))
117 #define zval_mul(z1, z2, z3) (mpz_mul(z1, z2, z3))
122 #define zval_div(z1, z2, z3) (mpz_fdiv_q(z1, z2, z3))
127 #define zval_addmul(z1, z2, z3) (mpz_addmul(z1, z2, z3))
132 #define zval_submul(z1, z2, z3) (mpz_submul(z1, z2, z3))
137 #define zval_neg(z1, z2) (mpz_neg(z1, z2))
142 #define zval_abs(z1, z2) (mpz_abs(z1, z2))
147 #define zval_mod(z1, z2, z3) (mpz_mod(z1, z2, z3))
154 #define zval_gcd(z1, z2, z3) (mpz_gcd(z1, z2, z3))
161 #define zval_lcm(z1, z2, z3) (mpz_lcm(z1, z2, z3))
168 #define zval_cmp(z1, z2) (mpz_cmp(z1, z2))
175 #define zval_cmp_i(z, n) (mpz_cmp_si(z, n))
180 #define zval_sgn(z) (mpz_sgn(z))
185 #define zval_equal(z1, z2) (zval_cmp(z1, z2) == 0)
191 #define zval_equal_i(z, n) (zval_cmp_i(z, n) == 0)
196 #define zval_fprint(stream, z) (mpz_out_str(stream, 10, z))
201 #define zval_print(z) (mpz_out_str(stdout, 10, z))
227 #define qval_canonicalize(q) (mpq_canonicalize(q))
232 #define qval_init(q) (mpq_init(q))
237 #define qval_clear(q) (mpq_clear(q))
242 #define qval_set(q1, q2) (mpq_set(q1, q2))
247 #define qval_set_i(q1, q2num, q2den) (mpq_set_si(q1, q2num, q2den))
252 #define qval_add(q1, q2, q3) (mpq_add(q1, q2, q3))
257 #define qval_sub(q1, q2, q3) (mpq_sub(q1, q2, q3)(
262 #define qval_mul(q1, q2, q3) (mpq_mul(q1, q2, q3))
267 #define qval_div(q1, q2, q3) (mpq_div(q1, q2, q3))
272 #define qval_neg(q1, q2) (mpq_neg(q1, q2))
277 #define qval_abs(q1, q2) (mpq_abs(q1, q2))
282 #define qval_inv(q1, q2) (mpq_inv(q1, q2))
291 #define qval_cmp(q1, q2) (mpq_cmp(q1, q2))
299 #define qval_cmp_i(q1, q2num, q2den) (mpq_cmp_si(q1, q2num, q2den))
304 #define qval_sgn(q) (mpq_sgn(q))
311 #define qval_equal(q1, q2) (mpq_equal(q1, q2))
317 #define qval_equal_i(q1, q2num, q2den) (qval_cmp_i(q1, q2num, q2den) == 0)
322 #define qval_fprint(stream, q) (mpq_out_str(stream, 10, q))
327 #define qval_print(q) (mpq_out_str(stdout, 10, q))
qval_s qval_t[1]
Type of rational numbers.
mpz_t zval_t
Type of integer numbers.