|
Packit Service |
2e9770 |
/* mpc_get_c, mpc_get_lc -- Transform mpc number into C complex number
|
|
Packit Service |
2e9770 |
|
|
Packit Service |
2e9770 |
Copyright (C) INRIA, 2010
|
|
Packit Service |
2e9770 |
|
|
Packit Service |
2e9770 |
This file is part of the MPC Library.
|
|
Packit Service |
2e9770 |
|
|
Packit Service |
2e9770 |
The MPC Library is free software; you can redistribute it and/or modify
|
|
Packit Service |
2e9770 |
it under the terms of the GNU Lesser General Public License as published by
|
|
Packit Service |
2e9770 |
the Free Software Foundation; either version 2.1 of the License, or (at your
|
|
Packit Service |
2e9770 |
option) any later version.
|
|
Packit Service |
2e9770 |
|
|
Packit Service |
2e9770 |
The MPC Library is distributed in the hope that it will be useful, but
|
|
Packit Service |
2e9770 |
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
Packit Service |
2e9770 |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
Packit Service |
2e9770 |
License for more details.
|
|
Packit Service |
2e9770 |
|
|
Packit Service |
2e9770 |
You should have received a copy of the GNU Lesser General Public License
|
|
Packit Service |
2e9770 |
along with the MPC Library; see the file COPYING.LIB. If not, write to
|
|
Packit Service |
2e9770 |
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
|
Packit Service |
2e9770 |
MA 02111-1307, USA. */
|
|
Packit Service |
2e9770 |
|
|
Packit Service |
2e9770 |
#include "config.h"
|
|
Packit Service |
2e9770 |
|
|
Packit Service |
2e9770 |
#if HAVE_COMPLEX_H
|
|
Packit Service |
2e9770 |
# include <complex.h>
|
|
Packit Service |
2e9770 |
#endif
|
|
Packit Service |
2e9770 |
|
|
Packit Service |
2e9770 |
#include "mpc-impl.h"
|
|
Packit Service |
2e9770 |
|
|
Packit Service |
2e9770 |
#if defined _MPC_H_HAVE_COMPLEX
|
|
Packit Service |
2e9770 |
double _Complex
|
|
Packit Service |
2e9770 |
mpc_get_dc (mpc_srcptr op, mpc_rnd_t rnd) {
|
|
Packit Service |
2e9770 |
return I * mpfr_get_d (mpc_imagref (op), MPC_RND_IM (rnd))
|
|
Packit Service |
2e9770 |
+ mpfr_get_d (mpc_realref (op), MPC_RND_RE (rnd));
|
|
Packit Service |
2e9770 |
}
|
|
Packit Service |
2e9770 |
|
|
Packit Service |
2e9770 |
long double _Complex
|
|
Packit Service |
2e9770 |
mpc_get_ldc (mpc_srcptr op, mpc_rnd_t rnd) {
|
|
Packit Service |
2e9770 |
return I * mpfr_get_ld (mpc_imagref (op), MPC_RND_IM (rnd))
|
|
Packit Service |
2e9770 |
+ mpfr_get_ld (mpc_realref (op), MPC_RND_RE (rnd));
|
|
Packit Service |
2e9770 |
}
|
|
Packit Service |
2e9770 |
#endif
|