summaryrefslogtreecommitdiff
path: root/mpq/set_d.c
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2012-06-08 21:54:49 +0200
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2012-06-08 21:54:49 +0200
commitd278771c99ea01862912a8bb2d074ed26798992e (patch)
treed283f61612e80d0bc072deb689192c57a367f1d7 /mpq/set_d.c
parent621a1088c537d37f9c4e252d598436da428d067d (diff)
downloadgmp-d278771c99ea01862912a8bb2d074ed26798992e.tar.gz
(MPZ_NEWALLOC): New macro. Use it in mpq and some mpz.
Diffstat (limited to 'mpq/set_d.c')
-rw-r--r--mpq/set_d.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mpq/set_d.c b/mpq/set_d.c
index 1936587a6..c56ef5d69 100644
--- a/mpq/set_d.c
+++ b/mpq/set_d.c
@@ -71,7 +71,7 @@ mpq_set_d (mpq_ptr dest, double d)
}
dn = -exp;
- np = MPZ_REALLOC (NUM(dest), 3);
+ np = MPZ_NEWALLOC (NUM(dest), 3);
#if LIMBS_PER_DOUBLE == 4
if ((tp[0] | tp[1] | tp[2]) == 0)
np[0] = tp[3], nn = 1;
@@ -98,7 +98,7 @@ mpq_set_d (mpq_ptr dest, double d)
#endif
dn += nn + 1;
ASSERT_ALWAYS (dn > 0);
- dp = MPZ_REALLOC (DEN(dest), dn);
+ dp = MPZ_NEWALLOC (DEN(dest), dn);
MPN_ZERO (dp, dn - 1);
dp[dn - 1] = 1;
count_trailing_zeros (c, np[0] | dp[0]);
@@ -115,7 +115,7 @@ mpq_set_d (mpq_ptr dest, double d)
else
{
nn = exp;
- np = MPZ_REALLOC (NUM(dest), nn);
+ np = MPZ_NEWALLOC (NUM(dest), nn);
switch (nn)
{
default: