From 83e918ac68973d697239ee2129b4e64ad15207b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Wed, 2 Feb 2011 19:00:52 +0000 Subject: [PATCH] improve comparison of terms. --- C/gmp_support.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/C/gmp_support.c b/C/gmp_support.c index d8f2afc0e..c28159da8 100755 --- a/C/gmp_support.c +++ b/C/gmp_support.c @@ -1299,13 +1299,19 @@ Yap_gmp_tcmp_big_big(Term t1, Term t2) if (pt1[1] == BIG_INT) { return 1; - } else { + } else if (pt1[1] == BIG_RATIONAL) { b1 = Yap_BigRatOfTerm(t1); + } else if (pt1[1] == BIG_RATIONAL) { + b1 = Yap_BigRatOfTerm(t1); + } else { + return pt1-pt2; } if (pt2[1] == BIG_INT) { return -1; - } else { + } else if (pt2[1] == BIG_RATIONAL) { b2 = Yap_BigRatOfTerm(t2); + } else { + return pt1-pt2; } return mpq_cmp(b1, b2); }