triangle_reflection_complex/qext.h

38 lines
830 B
C
Raw Normal View History

2022-04-15 16:23:27 +00:00
#ifndef QEXT_H
#define QEXT_H
#include <gmp.h>
#define QEXT_RANK 4
struct qext_number_internal {
int rk;
mpq_t *a;
};
typedef struct qext_number_internal qext_number[1];
void qext_init(qext_number x);
void qext_clear(qext_number x);
void qext_set(qext_number x, qext_number y);
void qext_set_int(qext_number x, int y);
void qext_add(qext_number result, qext_number x, qext_number y);
void qext_sub(qext_number result, qext_number x, qext_number y);
void qext_mul(qext_number out, qext_number x, qext_number y);
void qext_div(qext_number out, qext_number x, qext_number y);
int qext_cmp(qext_number x, qext_number y);
void qext_print(qext_number x);
void qext_sprint(qext_number x);
static void qext_set_zero(qext_number x)
{
qext_set_int(x, 0);
}
static void qext_set_one(qext_number x)
{
qext_set_int(x, 1);
}
#endif