Skip to content

Commit

Permalink
ring Z via longrat: some preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes14 committed Feb 2, 2016
1 parent 1b979c2 commit 25118db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
10 changes: 4 additions & 6 deletions libpolys/coeffs/longrat.cc
Expand Up @@ -88,7 +88,7 @@ void nlInpIntDiv(number &a, number b, const coeffs r);

#ifdef LDEBUG
#define nlTest(a, r) nlDBTest(a,__FILE__,__LINE__, r)
BOOLEAN nlDBTest(number a, char *f,int l, const coeffs r);
BOOLEAN nlDBTest(number a, const char *f,int l, const coeffs r);
#else
#define nlTest(a, r) do {} while (0)
#endif
Expand All @@ -112,7 +112,7 @@ BOOLEAN nlDBTest(number a, char *f,int l, const coeffs r);
static inline number nlShort3(number x) // assume x->s==3
{
assume(x->s==3);
if (mpz_cmp_ui(x->z,(long)0)==0)
if (mpz_cmp_si(x->z,(long)0)==0)
{
mpz_clear(x->z);
FREE_RNUMBER(x);
Expand Down Expand Up @@ -935,10 +935,7 @@ int nlDivComp(number a, number b, const coeffs r)

number nlGetUnit (number n, const coeffs r)
{
if (nlGreaterZero(n, r))
return INT_TO_SR(1);
else
return INT_TO_SR(-1);
return INT_TO_SR(1);
}

coeffs nlQuot1(number c, const coeffs r)
Expand Down Expand Up @@ -2584,6 +2581,7 @@ static number nlInitMPZ(mpz_t m, const coeffs)
z->debug=123456;
#endif
mpz_init_set(z->z, m);
z=nlShort3(z);
return z;
}

Expand Down
1 change: 0 additions & 1 deletion libpolys/coeffs/longrat.h
Expand Up @@ -110,7 +110,6 @@ static FORCE_INLINE BOOLEAN nlIsInteger(number q, const coeffs r)
number nlModP(number q, const coeffs Q, const coeffs Zp);
void nlNormalize(number &x, const coeffs r);
void nlInpGcd(number &a, number b, const coeffs r);
void nlDelete(number *a, const coeffs r);


/// create a rational i/j (implicitly) over Q
Expand Down

0 comments on commit 25118db

Please sign in to comment.