more fixes for bignum support in PLStream.
This commit is contained in:
@@ -1065,6 +1065,9 @@ writeTerm2(term_t t, int prec, write_options *options, bool arg)
|
||||
}
|
||||
}
|
||||
|
||||
#if __YAP_PROLOG__
|
||||
t = Yap_CvtTerm(t);
|
||||
#endif
|
||||
if ( PL_get_atom(t, &a) )
|
||||
{ if ( !arg && prec < 1200 && priorityOperator((Module)NULL, a) > 0 )
|
||||
{ if ( PutOpenBrace(out) &&
|
||||
|
@@ -381,9 +381,14 @@ PL_get_number(term_t l, number *n) {
|
||||
n->type = V_INTEGER;
|
||||
n->value.i = YAP_IntOfTerm(t);
|
||||
#ifdef O_GMP
|
||||
} else {
|
||||
} else if (YAP_IsBigNumTerm(t)) {
|
||||
n->type = V_MPZ;
|
||||
mpz_init(&n->value.mpq);
|
||||
YAP_BigNumOfTerm(t, &n->value.mpz);
|
||||
} else {
|
||||
n->type = V_MPQ;
|
||||
mpq_init(&n->value.mpq);
|
||||
YAP_RationalOfTerm(t, &n->value.mpq);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@@ -149,6 +149,8 @@ void PL_license(const char *license, const char *module);
|
||||
#define isTaggedInt(A) YAP_IsIntTerm(A)
|
||||
#define valInt(A) YAP_IntOfTerm(A)
|
||||
|
||||
extern term_t Yap_CvtTerm(term_t ts);
|
||||
|
||||
#define clearNumber(n)
|
||||
|
||||
inline static int
|
||||
|
Reference in New Issue
Block a user