summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-04-25 15:06:34 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-04-25 15:06:34 +0000
commit0ba13038d17723e3297e1e80e0985c8bd260576d (patch)
treedcdf28daee753331d5d4ac10eadd0ffc76913b80 /src
parentdc5c66571ff603f86c3191e614b2bc80a83a8887 (diff)
downloadmpfr-0ba13038d17723e3297e1e80e0985c8bd260576d.tar.gz
[src/gmp_op.c] Fixed bug in mpfr_cmp_q when the denominator of the
mpq_t argument is 0. [tests/tgmpop.c] Added tests. (merged changesets r12499,12502 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/4.0@12664 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src')
-rw-r--r--src/gmp_op.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gmp_op.c b/src/gmp_op.c
index dd3165195..eab65479c 100644
--- a/src/gmp_op.c
+++ b/src/gmp_op.c
@@ -452,7 +452,7 @@ mpfr_cmp_q (mpfr_srcptr x, mpq_srcptr q)
mpfr_prec_t p;
MPFR_SAVE_EXPO_DECL (expo);
- if (MPFR_UNLIKELY (mpq_denref (q) == 0))
+ if (MPFR_UNLIKELY (mpz_sgn (mpq_denref (q)) == 0))
{
/* q is an infinity or NaN */
mpfr_init2 (t, 2);