diff --git a/C/absmi.c b/C/absmi.c index d669359ee..9302656d8 100755 --- a/C/absmi.c +++ b/C/absmi.c @@ -9050,8 +9050,14 @@ Yap_absmi(int inp) Functor f0 = FunctorOfTerm(d0); if (IsExtensionFunctor(f0)) { switch ((CELL)f0) { - case (CELL)FunctorLongInt: case (CELL)FunctorBigInt: + { CELL *pt = RepAppl(d0); + if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) { + PREG = PREG->u.xl.F; + GONext(); + } + } + case (CELL)FunctorLongInt: PREG = NEXTOP(PREG, xl); GONext(); default: @@ -9087,10 +9093,14 @@ Yap_absmi(int inp) Functor f0 = FunctorOfTerm(d0); if (IsExtensionFunctor(f0)) { switch ((CELL)f0) { - case (CELL)FunctorLongInt: -#ifdef USE_GMP case (CELL)FunctorBigInt: -#endif + { CELL *pt = RepAppl(d0); + if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) { + PREG = PREG->u.yl.F; + GONext(); + } + } + case (CELL)FunctorLongInt: PREG = NEXTOP(PREG, yl); GONext(); default: @@ -9156,11 +9166,15 @@ Yap_absmi(int inp) Functor f0 = FunctorOfTerm(d0); if (IsExtensionFunctor(f0)) { switch ((CELL)f0) { + case (CELL)FunctorBigInt: + { CELL *pt = RepAppl(d0); + if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) { + PREG = PREG->u.xl.F; + GONext(); + } + } case (CELL)FunctorLongInt: case (CELL)FunctorDouble: -#ifdef USE_GMP - case (CELL)FunctorBigInt: -#endif PREG = NEXTOP(PREG, xl); GONext(); default: @@ -9197,11 +9211,15 @@ Yap_absmi(int inp) Functor f0 = FunctorOfTerm(d0); if (IsExtensionFunctor(f0)) { switch ((CELL)f0) { + case (CELL)FunctorBigInt: + { CELL *pt = RepAppl(d0); + if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) { + PREG = PREG->u.yl.F; + GONext(); + } + } case (CELL)FunctorLongInt: case (CELL)FunctorDouble: -#ifdef USE_GMP - case (CELL)FunctorBigInt: -#endif PREG = NEXTOP(PREG, yl); GONext(); default: @@ -9210,7 +9228,7 @@ Yap_absmi(int inp) } } } - PREG = PREG->u.xl.F; + PREG = PREG->u.yl.F; GONext(); derefa_body(d0, pt0, number_y_unk, number_y_nvar); diff --git a/C/inlines.c b/C/inlines.c index a8a79a925..1c43324d5 100644 --- a/C/inlines.c +++ b/C/inlines.c @@ -96,10 +96,13 @@ p_integer( USES_REGS1 ) Functor f0 = FunctorOfTerm(d0); if (IsExtensionFunctor(f0)) { switch ((CELL)f0) { - case (CELL)FunctorLongInt: -#ifdef USE_GMP case (CELL)FunctorBigInt: -#endif + { CELL *pt = RepAppl(d0); + if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) { + return FALSE; + } + } + case (CELL)FunctorLongInt: return(TRUE); default: return(FALSE); @@ -131,11 +134,14 @@ p_number( USES_REGS1 ) Functor f0 = FunctorOfTerm(d0); if (IsExtensionFunctor(f0)) { switch ((CELL)f0) { + case (CELL)FunctorBigInt: + { CELL *pt = RepAppl(d0); + if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) { + return FALSE; + } + } case (CELL)FunctorLongInt: case (CELL)FunctorDouble: -#ifdef USE_GMP - case (CELL)FunctorBigInt: -#endif return(TRUE); default: return(FALSE);