X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/f1140c41e9297d14386ee18fbed7a9686d223024..4739c68a6cb81cae53cd7df694ecd6176d6f11f8:/mp-sqrt.c diff --git a/mp-sqrt.c b/mp-sqrt.c index 7b65ec0..01fe000 100644 --- a/mp-sqrt.c +++ b/mp-sqrt.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mp-sqrt.c,v 1.3 2001/02/03 12:00:29 mdw Exp $ + * $Id: mp-sqrt.c,v 1.5 2004/04/08 01:36:15 mdw Exp $ * * Compute integer square roots * @@ -27,21 +27,6 @@ * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: mp-sqrt.c,v $ - * Revision 1.3 2001/02/03 12:00:29 mdw - * Now @mp_drop@ checks its argument is non-NULL before attempting to free - * it. Note that the macro version @MP_DROP@ doesn't do this. - * - * Revision 1.2 2000/10/08 12:02:21 mdw - * Use @MP_EQ@ instead of @MP_CMP@. - * - * Revision 1.1 2000/06/22 19:01:44 mdw - * Compute (approximations to) integer square roots. - * - */ - /*----- Header files ------------------------------------------------------*/ #include "mp.h" @@ -85,7 +70,6 @@ mp *mp_sqrt(mp *d, mp *a) z >>= 1; mp_copy(a); d = mp_lsr(d, a, z); - mp_drop(a); /* --- Main approximation --- * * @@ -118,6 +102,7 @@ mp *mp_sqrt(mp *d, mp *a) /* --- Finished, at last --- */ + mp_drop(a); mp_drop(q); mp_drop(r); return (d);