summaryrefslogtreecommitdiff
path: root/mpfr/mpz_set_fr.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2002-01-22 01:14:07 +0100
committerKevin Ryde <user42@zip.com.au>2002-01-22 01:14:07 +0100
commit6fa274ffb8eed054dec60167616a05736c50c267 (patch)
tree0f5b1026e36f7c00bd8927d8ef4d7e71f9b383cb /mpfr/mpz_set_fr.c
parent3fc24acb70b780d3e9e0b54e73c676d49f4c259b (diff)
downloadgmp-6fa274ffb8eed054dec60167616a05736c50c267.tar.gz
* mpfr/mpz_set_fr.c: Produce correct mpz_t for f==0.
Diffstat (limited to 'mpfr/mpz_set_fr.c')
-rw-r--r--mpfr/mpz_set_fr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mpfr/mpz_set_fr.c b/mpfr/mpz_set_fr.c
index 38643a336..ff5c636b7 100644
--- a/mpfr/mpz_set_fr.c
+++ b/mpfr/mpz_set_fr.c
@@ -1,6 +1,6 @@
/* mpz_set_fr -- set a multiple-precision integer from a floating-point number
-Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the MPFR Library.
@@ -51,7 +51,7 @@ mpz_set_fr (mpz_ptr z, mpfr_srcptr f)
else
MPN_COPY (PTR(z), MPFR_MANT(f), fn);
- SIZ(z) = fn;
+ SIZ(z) = (MPFR_MANT(f)[fn-1] == 0 ? 0 : fn);
return MPFR_EXP(f) - MPFR_PREC(f);
}