35 #ifdef LINEAR_ARITH_MULPREC_H
36 #error "arith_fixprec.h and arith_mulprec.h are both loaded"
39 #ifndef LINEAR_ARITH_FIXPREC_H
40 #define LINEAR_ARITH_FIXPREC_H
48 #define NOWUNUSED __attribute__((unused))
66 #define zval_init(z) ((z) = 0)
76 #define zval_set(z1, z2) ((z1) = (z2))
81 #define zval_set_i(z, n) ((z) = (n))
86 #define zval_init_set(z1, z2) ((z1) = (z2))
91 #define zval_init_set_i(z, n) ((z) = (n))
96 #define zval_get_i(z) (z)
101 #define zval_add(z1, z2, z3) ((z1) = (z2) + (z3))
106 #define zval_sub(z1, z2, z3) ((z1) = (z2) - (z3))
111 #define zval_mul(z1, z2, z3) ((z1) = value_protected_mult(z2, z3))
116 #define zval_div(z1, z2, z3) ((z1) = (z2) / (z3))
121 #define zval_addmul(z1, z2, z3) ((z1) += value_protected_mult(z2, z3))
126 #define zval_submul(z1, z2, z3) ((z1) -= value_protected_mult(z2, z3))
131 #define zval_neg(z1, z2) ((z1) = -(z2))
136 #define zval_abs(z1, z2) ((z1) = ABS(z2))
141 #define zval_mod(z1, z2, z3) ((z1) = (z2) % (z3))
148 #define zval_gcd(z1, z2, z3) ((z1) = pgcd(z2, z3))
155 #define zval_lcm(z1, z2, z3) ((z1) = ppcm(z2, z3))
162 #define zval_cmp(z1, z2) ((z1) - (z2))
169 #define zval_cmp_i(z, n) ((z) - (n))
174 #define zval_sgn(z) (value_sign(z))
179 #define zval_equal(z1, z2) ((z1) == (z2))
185 #define zval_equal_i(z, n) ((z) == (n))
190 #define zval_fprint(stream, z) (fprintf(stream, "%li", z))
195 #define zval_print(z) (printf("%li", z))
258 #define qval_clear(q)
319 zval_mul(q1->num, q2->num, q3->num);
320 zval_mul(q1->den, q2->den, q3->den);
331 zval_mul(q1->num, q2->num, q3->den);
433 #define qval_equal_i(q1, q2num, q2den) (qval_cmp_i(q1, q2num, q2den) == 0)
452 #define qval_print(q) (qval_fprint(stdout, q))
static int NOWUNUSED qval_sgn(qval_t q)
Return +1 if q > 0, 0 if q = 0, and -1 if q < 0.
#define zval_submul(z1, z2, z3)
Set z1 to z1 - z2 times z3.
qval_s qval_t[1]
Type of rational numbers.
#define zval_mul(z1, z2, z3)
Set z1 to z2 times z3.
#define zval_abs(z1, z2)
Set z1 to the absolute value of z2.
static void NOWUNUSED qval_set(qval_t q1, qval_t q2)
Set the value of q1 from q2.
#define zval_clear(z)
Free the space occupied by z.
#define zval_div(z1, z2, z3)
Set z1 to z2/z3.
#define zval_cmp(z1, z2)
Compare z1 and z2.
static void NOWUNUSED qval_canonicalize(qval_t q)
Remove any factors that are common to the numerator and denominator of q, and make the denominator po...
#define zval_sgn(z)
Return +1 if z > 0, 0 if z = 0, and -1 if z < 0.
#define zval_set_i(z, n)
Set the value of z from the signed long n.
#define zval_fprint(stream, z)
Output z on stdio stream stream.
long int zval_t
Type of integer numbers.
static void NOWUNUSED qval_div(qval_t q1, qval_t q2, qval_t q3)
Set q1 to q2/q3.
static int NOWUNUSED qval_equal(qval_t q1, qval_t q2)
Return non-zero if q1 and q2 are equal, zero if they are non-equal.
#define zval_set(z1, z2)
Set the value of z1 from z2.
static void NOWUNUSED qval_mul(qval_t q1, qval_t q2, qval_t q3)
Set q1 to q2 times q3.
#define zval_gcd(z1, z2, z3)
Set z1 to the greatest common divisor of z2 and z3.
#define zval_init(z)
Initialize z and set its value to 0.
static void NOWUNUSED qval_inv(qval_t q1, qval_t q2)
Set q1 to 1/q2.
static void NOWUNUSED qval_init(qval_t q)
Initialize q and set its value to 0/1.
static int NOWUNUSED qval_fprint(FILE *stream, qval_t q)
Output q on stdio stream stream.
#define zval_cmp_i(z, n)
Compare z with a signed long n.
#define zval_addmul(z1, z2, z3)
Set z1 to z1 + z2 times z3.
static void NOWUNUSED qval_add(qval_t q1, qval_t q2, qval_t q3)
Set q1 to q2 + q3.
static int NOWUNUSED qval_cmp(qval_t q1, qval_t q2)
Compare q1 and q2.
static void NOWUNUSED qval_neg(qval_t q1, qval_t q2)
Set q1 to -q2.
#define zval_neg(z1, z2)
Set z1 to -z2.
static int NOWUNUSED qval_cmp_i(qval_t q1, Value q2num, Value q2den)
Compare q1 and q2num/q2den.
static void qval_canonicalize_unsafe(qval_t q)
static void NOWUNUSED qval_set_i(qval_t q1, Value q2num, Value q2den)
Set the value of q to q2num/q2den.
#define zval_lcm(z1, z2, z3)
Set z1 to the least common multiple of z2 and z3.
static void NOWUNUSED qval_sub(qval_t q1, qval_t q2, qval_t q3)
Set q1 to q2 - q3.
static void NOWUNUSED qval_abs(qval_t q1, qval_t q2)
Set q1 to the absolute value of q2.
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...