Import Upstream version 0.8.2
[platform/upstream/mpc.git] / src / get_prec2.c
1 /* mpc_get_prec2 -- returns the precisions of the real and of the imaginary
2 part through the first two arguments
3
4 Copyright (C) 2007, 2009 Andreas Enge, Philippe Th\'eveny
5
6 This file is part of the MPC Library.
7
8 The MPC Library is free software; you can redistribute it and/or modify
9 it under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or (at your
11 option) any later version.
12
13 The MPC Library is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
16 License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with the MPC Library; see the file COPYING.LIB.  If not, write to
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21 MA 02111-1307, USA. */
22
23 #include "mpc-impl.h"
24
25 void
26 mpc_get_prec2 (mp_prec_t *pr, mp_prec_t *pi, mpc_srcptr x)
27 {
28    *pr = MPFR_PREC (MPC_RE (x));
29    *pi = MPFR_PREC (MPC_IM (x));
30 }