diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-09-11 16:49:11 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-09-11 16:49:11 +0000 |
commit | 1c24e6a15a2eddc5145422d5b6321ee14eac288e (patch) | |
tree | 4191f7113b3bd472100f16dc847ae51e3cd5c790 /inits.c | |
parent | 101429a324956af3411efa6209af9597a3d7f4f1 (diff) | |
download | mpfr-1c24e6a15a2eddc5145422d5b6321ee14eac288e.tar.gz |
New functions mpfr_inits, mpfr_inits2 and mpfr_clears to initialize or
free several floating-point numbers (written by Patrick PĂ©lissier).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2409 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'inits.c')
-rw-r--r-- | inits.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/inits.c b/inits.c new file mode 100644 index 000000000..19e6dd643 --- /dev/null +++ b/inits.c @@ -0,0 +1,40 @@ +/* mpfr_inits -- initialize several floating-point numbers + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the MPFR Library. + +The MPFR Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The MPFR Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the MPFR Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +MA 02111-1307, USA. */ + +#include <stdarg.h> +#include "gmp.h" +#include "gmp-impl.h" +#include "mpfr.h" +#include "mpfr-impl.h" + +void +mpfr_inits (mpfr_ptr x, ...) +{ + va_list arg; + + va_start (arg, x); + while (x != 0) + { + mpfr_init (x); + x = (mpfr_ptr) va_arg (arg, mpfr_ptr); + } + va_end (arg); +} |