|
Packit |
80c72f |
/* mpc_pow_fr -- Raise a complex number to a floating-point power.
|
|
Packit |
80c72f |
|
|
Packit |
80c72f |
Copyright (C) 2009, 2011 INRIA
|
|
Packit |
80c72f |
|
|
Packit |
80c72f |
This file is part of GNU MPC.
|
|
Packit |
80c72f |
|
|
Packit |
80c72f |
GNU MPC is free software; you can redistribute it and/or modify it under
|
|
Packit |
80c72f |
the terms of the GNU Lesser General Public License as published by the
|
|
Packit |
80c72f |
Free Software Foundation; either version 3 of the License, or (at your
|
|
Packit |
80c72f |
option) any later version.
|
|
Packit |
80c72f |
|
|
Packit |
80c72f |
GNU MPC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
Packit |
80c72f |
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
Packit |
80c72f |
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
|
Packit |
80c72f |
more details.
|
|
Packit |
80c72f |
|
|
Packit |
80c72f |
You should have received a copy of the GNU Lesser General Public License
|
|
Packit |
80c72f |
along with this program. If not, see http://www.gnu.org/licenses/ .
|
|
Packit |
80c72f |
*/
|
|
Packit |
80c72f |
|
|
Packit |
80c72f |
#include "mpc-impl.h"
|
|
Packit |
80c72f |
|
|
Packit |
80c72f |
int
|
|
Packit |
80c72f |
mpc_pow_fr (mpc_ptr z, mpc_srcptr x, mpfr_srcptr y, mpc_rnd_t rnd)
|
|
Packit |
80c72f |
{
|
|
Packit |
80c72f |
mpc_t yy;
|
|
Packit |
80c72f |
int inex;
|
|
Packit |
80c72f |
|
|
Packit |
80c72f |
/* avoid copying the significand of y by copying only the struct */
|
|
Packit |
80c72f |
mpc_realref(yy)[0] = y[0];
|
|
Packit |
80c72f |
mpfr_init2 (mpc_imagref(yy), MPFR_PREC_MIN);
|
|
Packit |
80c72f |
mpfr_set_ui (mpc_imagref(yy), 0, GMP_RNDN);
|
|
Packit |
80c72f |
inex = mpc_pow (z, x, yy, rnd);
|
|
Packit |
80c72f |
mpfr_clear (mpc_imagref(yy));
|
|
Packit |
80c72f |
return inex;
|
|
Packit |
80c72f |
}
|
|
Packit |
80c72f |
|