1/* mpc_add_si -- Add a complex number and a signed long int.
2
3Copyright (C) INRIA, 2011
4
5This file is part of the MPC Library.
6
7The MPC Library is free software; you can redistribute it and/or modify
8it under the terms of the GNU Lesser General Public License as published by
9the Free Software Foundation; either version 2.1 of the License, or (at your
10option) any later version.
11
12The MPC Library is distributed in the hope that it will be useful, but
13WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15License for more details.
16
17You should have received a copy of the GNU Lesser General Public License
18along with the MPC Library; see the file COPYING.LIB.  If not, write to
19the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20MA 02111-1307, USA. */
21
22#include "mpc-impl.h"
23
24int
25mpc_add_si (mpc_ptr rop, mpc_srcptr op1, long int op2, mpc_rnd_t rnd)
26{
27   int inex_re, inex_im;
28
29   inex_re = mpfr_add_si (MPC_RE (rop), MPC_RE (op1), op2, MPC_RND_RE (rnd));
30   inex_im = mpfr_set (MPC_IM (rop), MPC_IM (op1), MPC_RND_IM (rnd));
31
32   return MPC_INEX (inex_re, inex_im);
33}
34