Use mpz_sgn rather than comparisons against 0
* src/data.c (Fmod): Use mpz_sgn. * src/lisp.h (NATNUMP): Use mpz_sgn.
This commit is contained in:
parent
f966753727
commit
f822a2516d
2 changed files with 3 additions and 3 deletions
|
@ -3251,8 +3251,8 @@ Both X and Y must be numbers or markers. */)
|
|||
mpz_mod (result, *xmp, *ymp);
|
||||
|
||||
/* Fix the sign if needed. */
|
||||
cmpr = mpz_cmp_si (result, 0);
|
||||
cmpy = mpz_cmp_si (*ymp, 0);
|
||||
cmpr = mpz_sgn (result);
|
||||
cmpy = mpz_sgn (*ymp);
|
||||
if (cmpy < 0 ? cmpr > 0 : cmpr < 0)
|
||||
mpz_add (result, result, *ymp);
|
||||
|
||||
|
|
|
@ -2772,7 +2772,7 @@ INLINE bool
|
|||
NATNUMP (Lisp_Object x)
|
||||
{
|
||||
if (BIGNUMP (x))
|
||||
return mpz_cmp_si (XBIGNUM (x)->value, 0) >= 0;
|
||||
return mpz_sgn (XBIGNUM (x)->value) >= 0;
|
||||
return FIXNUMP (x) && 0 <= XFIXNUM (x);
|
||||
}
|
||||
INLINE bool
|
||||
|
|
Loading…
Add table
Reference in a new issue